3 ms·
> One thing I hate about CLI tool though, is that it's very hard to edit long commands in terminal. Apart from the "wrap it in a shell script" advice, I would
by paulmd 4y ago
> One thing I hate about CLI tool though, is that it's very hard to edit long commands in terminal.
Apart from the "wrap it in a shell script" advice, I would also note that in a bash-like terminal, home and end will jump to the start or the end of the current command buffer, and ctrl-del (or alt-del maybe?) or ctrl-arrow keys usually delete or move the cursor a whole word at a time, which makes it somewhat quicker to work rather than sitting there holding an arrow key or backspce.
Many here probably already know this, some may not!
- thrdbndndn 4y agoThanks, yeah I know these since I use them heavily in editor as well. Now this got me thinking: the main problem with terminal is that it doesn't seem to support "cut" (and consequently, "paste to replace selection"). So re-arranging a command string is always gonna be a pain regardless the complexity. I can see why it was this way historically, but not exactly sure why no modern terminal emulator gives this feature, even as optional.
- paulmd 4y agoone analogy might be the "cut and accumulate" feature in nano (and probably others) where a line is removed and appended to the clipboard, then you can paste and all those lines will be pasted off the clipboard at once. You could do that at a character level in the shell, if you wanted. No idea if any shells do though.
- wtch98 4y agoctrl-a and ctrl-e to start/end of line