mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-11-11 09:52:13 +03:00
Fix #4809
This commit is contained in:
parent
f2d6ba8775
commit
cac2c153c2
@ -112,10 +112,16 @@ else
|
||||
return $?
|
||||
}
|
||||
|
||||
if [ "$(printf "%s" "test" | command head -c 3 2> /dev/null)" = "tes" ]; then
|
||||
# using dd with bs=1 is very slow, so use head. On non GNU coreutils head
|
||||
# does not limit itself to reading -c bytes only from the pipe so we can potentially lose
|
||||
# some trailing data, for instance if the user starts typing. Cant be helped.
|
||||
# using dd with bs=1 is very slow, so use head. On non GNU coreutils head
|
||||
# does not limit itself to reading -c bytes only from the pipe so we can potentially lose
|
||||
# some trailing data, for instance if the user starts typing. Cant be helped.
|
||||
if [ "$(printf "%s" "test" | command ghead -c 3 2> /dev/null)" = "tes" ]; then
|
||||
# Some BSD based systems use ghead for GNU head which is strictly superior to
|
||||
# Broken System Design head, so prefer it.
|
||||
read_n_bytes_from_tty() {
|
||||
command ghead -c "$1" < /dev/tty
|
||||
}
|
||||
elif [ "$(printf "%s" "test" | command head -c 3 2> /dev/null)" = "tes" ]; then
|
||||
read_n_bytes_from_tty() {
|
||||
command head -c "$1" < /dev/tty
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user