I am a rookie at using Terminal, and I am acquainting myself with it by simultaneously learning Git on it. Still new to the shortcuts therein, I accidentally pressed Cmd+K, and the whole screen went blank, giving me a little heart-attack when I couldn't "scroll up".

However, checking the git status and running ls revealed that nothing had really been "undone".

I couldn't find any info on the web for this command, which is different than Ctrl+L, the clear command.


  1. What is actually happening when I press Cmd+K?
  2. Having cleared the screen using Cmd+K, is there any way we can resurrect the commands back on the screen?
  • 1
    Is it Cmd-K or Cmd-L? Did you check the menus in Terminal for any shortcuts shown there?
    – nohillside
    May 13 at 12:52
  • @nohillside I did not check the shortcuts, but I just re-verified that the Cmd + K does give what I write in the op. (I am not able to find any "keyboard shortcuts" in the menus of the Terminal.)
    – Atom
    May 13 at 12:58
  • @Atom why does the first part of the question say Cmd-L ?
    – mmmmmm
    May 13 at 13:22
  • @mmmmmm Oh, I did mess it up. Sorry, fixed!
    – Atom
    May 13 at 13:25

1 Answer 1


Look at all the menus in an application to see the shortcuts.

For Terminal.app look in the Edit menu.

K Says clear to start. This clears all the text of the buffer just leaving the current prompt and command you are typing. In my quick test it seems to do the same as ^L

The shortcuts are all given in an Apple Support Guide https://support.apple.com/en-gb/guide/terminal/trmlshtcts/mac

I suspect the confusion that is because Apple menu says Clear to Start to differentiate it to the other clear commands e.g. clear to bookmark. As backing for that view iTerm does just call it clear and uses L based shortcuts for dealing with clear to mark.

As to getting the command back - well they have not been undone so the effects are there. Getting them back depends on your shell and its setup. The default zsh (and bash) setup will show the last commands when you press up arrow, you won't get the results that used to be shown back. There are shells that can store the results as well as the commands, xonsh for example. There are also terminal emulators that can show the command you have entered, e.g. iTerm

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .