Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unix Shell, brief mention of 'Ctrl + L' #1221

Open
JacobDorePorrett opened this issue Jul 19, 2021 · 6 comments
Open

Unix Shell, brief mention of 'Ctrl + L' #1221

JacobDorePorrett opened this issue Jul 19, 2021 · 6 comments
Labels
help wanted Looking for Contributors type:enhancement Propose enhancement to the lesson

Comments

@JacobDorePorrett
Copy link

JacobDorePorrett commented Jul 19, 2021

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.

@JacobDorePorrett JacobDorePorrett changed the title Unix Shell, brief mention of Unix Shell, brief mention of 'clear' or 'Ctrl + L' Jul 19, 2021
@JacobDorePorrett JacobDorePorrett changed the title Unix Shell, brief mention of 'clear' or 'Ctrl + L' Unix Shell, brief mention of 'Ctrl + L' Jul 19, 2021
@gcapes
Copy link
Contributor

gcapes commented Jul 19, 2021

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.

@slel
Copy link
Contributor

slel commented Jul 19, 2021

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).

@gdevenyi
Copy link
Contributor

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.

@JacobDorePorrett
Copy link
Author

JacobDorePorrett commented Jul 19, 2021

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.

@gcapes gcapes added help wanted Looking for Contributors type:enhancement Propose enhancement to the lesson labels Jul 27, 2021
@gdevenyi
Copy link
Contributor

gdevenyi commented Sep 7, 2021

Since they seem to work in our supported environments, I'd support a PR to add a small call-out to describe these features.

@clizarraga-UAD7
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Looking for Contributors type:enhancement Propose enhancement to the lesson
Projects
None yet
Development

No branches or pull requests

5 participants