Search code examples
terminalterminal-emulator

Change the behaviour of cooked mode


On a terminal, the cooked (canonical) mode allows the user to input in text, and the text is sent to the program when the user hits enter. While in cooked mode, the arrow keys don't work, and they just appear as ^[[A and similar, but backspace does.

So is it possible to allow arrow keys in the terminal? Ideally, I would be able to even specify my own default 'cooker' to use.

And if it is not possible, then why are all terminals like this?

If it helps, I use suckless terminal, but I would prefer a solution that works on all terminals.


Solution

  • As a workaround, you can run your commands with rlwrap, which provides readline's line editing, including arrow key movement.