mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-13 15:41:14 -03:00
For the same reason as before (upcoming multi-line autosuggestions), reapply1fdf37cc4a(__fish_echo: fully overwrite lines, 2025-09-17) after it was reverted inb7fabb11ac(Make command run by __fish_echo output to TTY for color detection, 2025-10-05) (Make command run by __fish_echo output to TTY for color detection, 2025-10-05). Use clear-to-end-of-screen to allow making "ls" output directly to the terminal. Alternatively, we could create a pseudo TTY (e.g. call something like "unbuffer ls --color=auto").
19 lines
655 B
Fish
19 lines
655 B
Fish
# localization: skip(private)
|
|
set -l erase_to_end_of_screen "$(
|
|
if status test-feature ignore-terminfo
|
|
echo \e\[J
|
|
else if type -q tput
|
|
tput ed
|
|
end
|
|
)"
|
|
|
|
function __fish_echo --inherit-variable erase_to_end_of_screen --description 'run the given command after the current commandline and redraw the prompt'
|
|
set -l line (commandline --line)
|
|
string >&2 repeat -N \n --count=(math (commandline | count) - $line + 1)
|
|
printf %s $erase_to_end_of_screen >&2
|
|
$argv >&2
|
|
string >&2 repeat -N \n --count=(math (count (fish_prompt)) - 1)
|
|
string >&2 repeat -N \n --count=(math $line - 1)
|
|
commandline -f repaint
|
|
end
|