1

I do run reset quite frequently while using GNOME Terminal. I've been trying to find a way to do (exactly) that using a shortcut. Reset and Clear (Ctrl + K) "resets" the terminal in a similar fashion, but I have to press Enter to get a prompt back.

Is there a way to get the behavior I'm describing?

I've tried iTerm 2.x in macOS, and Ctrl + K does exactly that, so I think there has to be a way to do this in GNOME Terminal as well, since this looks like a very basic workflow that many people might use on a daily basis.

x80486
  • 939
  • 2
  • 11
  • 31

1 Answers1

1

Add to your .bashrc:

bind -x '"\C-k":reset xterm'

Source the file:

$ . .bashrc

Now when you press Ctrl+k you should get the desired result.

schrodingerscatcuriosity
  • 12,087
  • 3
  • 29
  • 57
  • Somehow, this doesn't change anything for me. I get the same behavior: I have to press `Enter` to get the prompt back. – x80486 Jan 09 '22 at 14:34
  • @x80486 Take a look at [this post](https://unix.stackexchange.com/questions/93376/which-terminal-type-am-i-using) to see if some of the information there helps, I tried it with Zorin (gnome-terminal) and it worked... and now I'm on windows. – schrodingerscatcuriosity Jan 09 '22 at 14:39
  • @x80486 Try with other letter than k, `'"\C-j"` for example. – schrodingerscatcuriosity Jan 09 '22 at 14:41
  • OK, that did it! Looks like `Ctrl + k` is already bound (by default) so it takes precedence over this one. – x80486 Jan 09 '22 at 15:53