jupyterlite / cockle

In-browser bash-like shell implemented in TypeScript.
BSD 3-Clause "New" or "Revised" License
3 stars 2 forks source link

Standardise linefeed/newline handling #51

Closed ianthomas23 closed 2 months ago

ianthomas23 commented 2 months ago

Standardise linefeed/newline handling. On input from xterm we receive a carriage return \r to submit a command, but the options passed to xterm by JupyterLab require \r\n to both move to the next line and to the start of the line. Internally within cockle we emit a \n for a newline and ShellImpl.output, which calls the outputCallback passed in by the frontend, converts this to the required \r\n. Before this PR the conversion happened in TerminalOutput and in a number of other places for specific returns. It is better to keep it in just one place as is done here.