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

reset_clear doesn't show new prompt #703

Closed
IvoryJam opened this issue Jan 19, 2023 · 2 comments
Closed

reset_clear doesn't show new prompt #703

IvoryJam opened this issue Jan 19, 2023 · 2 comments

Comments

@IvoryJam
Copy link

Describe the bug
reset_clear doesn't show new prompt, left with an empty terminal window until you press enter or hit ctrl+l

To Reproduce
Steps to reproduce the behavior:

  1. Run command to reset and clear terminal (default is ctrl+shift+g)

Expected behavior
Clears the terminal and resets the scroll back while leaving prompt

Desktop:

  • OS or Linux Distribution: Fedora
  • Version 37
  • Display Technology: Wayland
  • Terminator: 2.1.2

Additional context
If it helps, konsole does what I would expect it to, clears the screen and resets scroll back, but it leaves the prompt at the top of the terminal window

@mattrose
Copy link
Member

This is the way it works with all of the vte-based terminal emulators.

@FernandoBasso
Copy link
Contributor

FernandoBasso commented Jan 22, 2023

@IvoryJam On my setup, I bound reset_clear to Ctrl+Shift+k (on br-abnt2 keyboard layout, it is easier to type than Ctrl+Shift+g). Then I follow with Ctrl-l.

Note that Ctrl-l is NOT a Terminator's feature, but a shell thing.

Bash is my default shell, so, for me, Ctrl-l is a readline feature. Other shells generally implement something similar. I found this while perusing man bash:

clear-display (M-C-l)
    Clear the screen and, if  possible,  the  terminal's  scrollback
    buffer,  then  redraw the current line, leaving the current line
    at the top of the screen.
clear-screen (C-l)
    Clear the screen, then redraw the current line, leaving the cur‐
    rent  line  at the top of the screen.  With an argument, refresh
    the current line without clearing the screen.

So, instead of doing Ctrl+Shift+k followed by Ctrl-l, I can simply do Ctrl-Alt-l. Note that this shortcut may be already taken by your window manager or desktop environment, which was the case for me: it was used by xflock4 to lock the screen.

It is possible to add a bash shortcut though:

$ bind -x '"\C-l": clear

Or to remap readline we can add something like this to ~/.inputrc:

##
# Clear scrollback and redraw current line.
#
"\C-l": clear-display

I have always been a little put of with “+” vs ”-” syntax to describe shortcuts. It seems Gtk stuff prefers the “+”, while shell-related documentation and configuration seems to prefer ”-”, including vim and emacs. The latter family of tools describe things like C-l rather than C+l or Ctrl+l.

Anyway, this is out of the scope of Terminator itself, but at least related and I learned some stuff researching on this today 🙂.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants