mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-12-24 18:53:51 +08:00
04c9134275
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
Render the command line buffer only until the last line we can fit on the screen. If the cursor pushes the viewport such that neither the prompt nor the first line of the command line buffer are visible, then we are "scrolled". In this case we need to make sure to erase any leftover prompt, so add a hack to disable the "shared_prefix" optimization that tries to minimize redraws. Down-arrow scrolls down only when on the last line, and up-arrow always scrolls up as much as possible. This is somewhat unconventional; probably we should change the up-arrow behavior but I guess it's a good idea to show the prompt whenever possible. In future we could solve that in a different way: we could keep the prompt visible even if we're scrolled. This would work well because at least the left prompt lives in a different column from the command line buffer. However this assumption breaks when the first line in the command line buffer is soft-wrapped, so keep this approach for now. Note that we're still broken when complete-and-search or history-pager try to draw a pager on top of an overfull screen. Will try to fix this later. Closes #7296
25 lines
507 B
Fish
25 lines
507 B
Fish
#RUN: %fish %s
|
|
#REQUIRES: command -v tmux
|
|
|
|
isolated-tmux-start
|
|
|
|
isolated-tmux send-keys 'bind alt-g "commandline -p -C -- -4"' Enter C-l
|
|
isolated-tmux send-keys 'echo bar|cat' \eg foo
|
|
tmux-sleep
|
|
isolated-tmux capture-pane -p
|
|
# CHECK: prompt 1> echo foobar|cat
|
|
|
|
isolated-tmux send-keys C-k C-u C-l 'commandline -i (seq $LINES) scroll_here' Enter
|
|
tmux-sleep
|
|
isolated-tmux capture-pane -p
|
|
# CHECK: 2
|
|
# CHECK: 3
|
|
# CHECK: 4
|
|
# CHECK: 5
|
|
# CHECK: 6
|
|
# CHECK: 7
|
|
# CHECK: 8
|
|
# CHECK: 9
|
|
# CHECK: 10
|
|
# CHECK: scroll_here
|