shell-novice
shell-novice copied to clipboard
Unix Shell, brief mention of 'Ctrl + L'
Hello,
http://swcarpentry.github.io/shell-novice/
It's good to know about clear to keep the screen clear, however in the same paragraph in the lesson it might be worth mentioning about 'Ctrl +L'. It would fit well in episode 2. http://swcarpentry.github.io/shell-novice/02-filedir/index.html
If you use and also share the keyboard shortcut 'Ctrl + L' it'll allow the screen to be clear while keeping the previous used commands. This would be helpful for going to new sections without deleting the results of the previous commands. The shortcut moves all the text up and basically clears the screen, with the main difference being you can scroll up to see what you've done previously.
Thanks for the suggestion. This is a nice shortcut, but does it work on git bash and terminal in macos? We don't want to be adding anything which only works on some systems.
On macOS, both in Terminal and iTerm2, keyboard shortcuts involving "Ctrl" such as
- Ctrl+A: go to start of line
- Ctrl+E: go to end of line
- Ctrl+K: delete from here to end of line
- Ctrl+L: clear screen
work exactly as on Linux, and they do use Ctrl.
(In other contexts, macOS uses Cmd where Linux and Windows use Ctrl; not in this case).
All the readline shortcuts, https://github.com/chzyer/readline/blob/master/doc/shortcut.md
I think we need a windows user to check if the git bash shell can properly handle these.
All the readline shortcuts, https://github.com/chzyer/readline/blob/master/doc/shortcut.md
I think we need a windows user to check if the git bash shell can properly handle these.
The readline shortcuts work in the git bash shell. I'm on windows and tested using the git bash shell.
Since they seem to work in our supported environments, I'd support a PR to add a small call-out to describe these features.
The Bash command line inherits by design some of the Emacs Editor commands. In MacOS you can run the command 'bindkey' and it will show all the key bindings or shortcuts built-in Bash/Zsh. This in practice helps you navigate and edit the 'history' of last typed commands.