wezterm icon indicating copy to clipboard operation
wezterm copied to clipboard

Scrolling forward (past the line) and using keyboard

Open goyalyashpal opened this issue 1 year ago • 10 comments

Is your feature request related to a problem? Please describe

  • I cant scroll using keyboard shortcuts --> have to use the mouse/touchpad
  • Also, the command prompt gets stuck in the bottom making it uneasy on the eye

Describe the solution you'd like

Ability to:

  1. scroll through the screen via some keyboard shortcut like Ctrl + arrow keys, and
  2. scroll past the last line upto the point that only last line is still visible on the screen

References: both of above are supported in:

  • text editors (like notepad3 ^arrow, geany alt-arrow, & vscodium ^arrow)
  • windows conhost ^arrow too, though that is a bit extreme and supports scrolling endlessly - which aint wanted either

Note: in editors too, scrolling the screen/viewerport is different than changing the cursor position

Describe alternatives you've considered

clear and ^l - which clears the screen, but sometimes i dont want to alter the contents, just scroll

(^ = Ctrl)

Additional context

Add any other context or screenshots about the feature request here.

Versions:

  • OS: windows 10 20H2
  • wezterm: 20220624-141144-bd1b7c5d

goyalyashpal avatar Jul 05 '22 02:07 goyalyashpal

kinda relevant maybe: https://github.com/wez/wezterm/issues/427

goyalyashpal avatar Jul 05 '22 02:07 goyalyashpal

There are a number of key assignments for scrolling: ScrollByLine ScrollByPage (SHIFT+PageUp/PageDown are bound to this by default) ScrollToBottom ScrollToPrompt ScrollToTop

wez avatar Jul 05 '22 03:07 wez

is any of these setup by default i.e. available to try directly or will i have to set those up?

seems it's the latter, but still, asking for confirmation

and i dont think any of these still scrolls past the last line, am i right??

goyalyashpal avatar Jul 05 '22 04:07 goyalyashpal

Please read my comment again; it explains about the defaults. The full list of defaults can be found at https://wezfurlong.org/wezterm/config/default-keys.html

It is not possible to scroll past the last line, as it is the last line and there are no lines after it.

wez avatar Jul 05 '22 04:07 wez

FWIW I also like to 'scroll' past the last line a bit (I use it to 'clear' my mind, give the screen some space), the way I do it is that in my shell I have mapped a key to send a few ANSI escape sequences to scroll the content of the terminal up. See:

  • https://github.com/bew/dotfiles/blob/1e1117fec1a043027a40e27434acf85d5fdeb00d/zsh/rc/mappings.zsh#L86
  • https://github.com/bew/dotfiles/blob/1e1117fec1a043027a40e27434acf85d5fdeb00d/zsh/rc/mappings.zsh#L137

Note: that I'd love to be able to scroll it back down while keeping the scrollback, however no escape sequence can do that. Kitty implemented one, and I asked to have it in westerm some time ago, not impl so far (maybe I'll just do it some day).. See: #1513

Not sure it's what you're looking for, maybe it'll help


I also implemented a clear the terminal but do not scrub scrollback content to replace Ctrl-L in my shell: https://github.com/bew/dotfiles/blob/1e1117fec1a043027a40e27434acf85d5fdeb00d/zsh/rc/mappings.zsh#L543 (for ZSH, taking care of the current cursor position, its position in the prompt buffer (if on a multiline buffer), and using the same mecanism as above to scroll the content until the cursor is at the top)

bew avatar Jul 05 '22 06:07 bew

@bew: Thanks for that snippet! This is what I came up with: seq 3 `tput lines`; tput clear;. Set 3 to 2 when not invoking manually, using a key binding for example.

MuhammedZakir avatar Jul 05 '22 08:07 MuhammedZakir

umh, i am just saying to push all the content above. as i already said, even the conhost (windows default terminal) does that (& all those editors too obv).

so...

i mean, i understand if there's some technical implementational problem for doing that, but i dont understand the logic behind following reply 😅😇

anyways, i will record the screen and share it here for better clearing up and illustrating what i mean

thanks

Wez Furlong wrote:

It is not possible to scroll past the last line, as it is the last line and there are no lines after it.

goyalyashpal avatar Jul 05 '22 11:07 goyalyashpal

here's the recording video with the editors and windows conhost terminal,

speed it up while watching to save time, and avoid jitteriness - i had no idea that recording @24fps would be that bad sorry with excessive scrolling

https://user-images.githubusercontent.com/19423063/178258999-d71e56b0-53f9-43c6-be8b-94a52401b0c8.mp4

goyalyashpal avatar Jul 11 '22 12:07 goyalyashpal

oh i forgot to show this, conhost has this property toggleable too, by the name of Disable scroll forward

2022.12.05

so, collection of names it's called with:

  • "scroll forward" in conhost
  • "scroll beyond last line" in vscodium
  • "scrolling at last line" in geany
  • "vertical overscroll (scroll below end of file)" in TeXStudio

goyalyashpal avatar Jul 13 '22 02:07 goyalyashpal

There is an issue with solution posted by @bew, and myself, it doesn't work when a program is running. This won't be a problem if there is a terminal-native option.

MuhammedZakir avatar Aug 19 '22 09:08 MuhammedZakir

hey @ wez , can u have an another look at it 😃

goyalyashpal avatar Mar 24 '23 11:03 goyalyashpal

lack of this in the terminals also make the video tutorials super hard to follow with subtitles turned on

also bad if you are a content creator for such tutorials...

as can be seen in this screenshot took from this video: CpTfQ-q6MPU

image

goyalyashpal avatar May 31 '23 08:05 goyalyashpal