preview-tui: update prompts (#980)

This commit is contained in:
luukvbaal 2021-04-30 15:29:11 +02:00 committed by GitHub
parent e8bebac168
commit 5ed2998023
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 20 deletions

View file

@ -53,10 +53,10 @@
# 'h'orizontal split or a 'v'ertical split (as in, the line that splits the # 'h'orizontal split or a 'v'ertical split (as in, the line that splits the
# windows will be horizontal or vertical). # windows will be horizontal or vertical).
# #
# Kitty users need `allow_remote_control` set to `yes`. To customize the # Kitty users need `allow_remote_control` set to `yes`, and `listen_on` set
# window split, `enabled_layouts` has to be set to `all` or `splits` (the # to e.g. "$TMPDIR/kitty". To customize the window split, `enabled_layouts`
# former is the default value). This terminal is also able to show images # has to be set to `all` or `splits` (the former is the default value).
# without extra dependencies. # This terminal is also able to show images without extra dependencies.
# #
# Shell: POSIX compliant # Shell: POSIX compliant
# Authors: Todd Yamakawa, Léo Villeveygoux, @Recidiviste, Mario Ortiz Manero, Luuk van Baal # Authors: Todd Yamakawa, Léo Villeveygoux, @Recidiviste, Mario Ortiz Manero, Luuk van Baal
@ -299,14 +299,12 @@ if [ "$PREVIEW_MODE" ]; then
else else
if [ ! -r "$NNN_FIFO" ]; then if [ ! -r "$NNN_FIFO" ]; then
clear clear
printf "No FIFO available! (\$NNN_FIFO='%s')\nPlease read the documentation" "$NNN_FIFO" printf "No FIFO available! (\$NNN_FIFO='%s')\nPlease read Usage in preview-tui." "$NNN_FIFO"
read -r _ cfg=$(stty -g); stty raw -echo; head -c 1; stty "$cfg"
elif [ "$KITTY_WINDOW_ID" ] && [ -z "$KITTY_LISTEN_ON" ]; then elif [ "$KITTY_WINDOW_ID" ] && [ -z "$KITTY_LISTEN_ON" ]; then
# The escape codes used to control kitty splits cause problems when run from a background process.
# Use --listen-on flag or listen_on config variable to avoid(https://sw.kovidgoyal.net/kitty/conf.html)
clear clear
printf "\$KITTY_LISTEN_ON not set!\nPlease add listen_on to your kitty.conf or start with the --listen-on flag." printf "\$KITTY_LISTEN_ON not set!\nPlease read Usage in preview-tui."
read -r _ cfg=$(stty -g); stty raw -echo; head -c 1; stty "$cfg"
else else
togglepreview "$1" & togglepreview "$1" &
fi fi

View file

@ -64,10 +64,10 @@
# 'h'orizontal split or a 'v'ertical split (as in, the line that splits the # 'h'orizontal split or a 'v'ertical split (as in, the line that splits the
# windows will be horizontal or vertical). # windows will be horizontal or vertical).
# #
# Kitty users need `allow_remote_control` set to `yes`. To customize the # Kitty users need `allow_remote_control` set to `yes`, and `listen_on` set
# window split, `enabled_layouts` has to be set to `all` or `splits` (the # to e.g. "$TMPDIR/kitty". To customize the window split, `enabled_layouts`
# former is the default value). This terminal is also able to show images # has to be set to `all` or `splits` (the former is the default value).
# without extra dependencies. # This terminal is also able to show images without extra dependencies.
# #
# Shell: POSIX compliant # Shell: POSIX compliant
# Authors: Todd Yamakawa, Léo Villeveygoux, @Recidiviste, Mario Ortiz Manero, Luuk van Baal # Authors: Todd Yamakawa, Léo Villeveygoux, @Recidiviste, Mario Ortiz Manero, Luuk van Baal
@ -406,14 +406,12 @@ if [ "$PREVIEW_MODE" ]; then
else else
if [ ! -r "$NNN_FIFO" ]; then if [ ! -r "$NNN_FIFO" ]; then
clear clear
printf "No FIFO available! (\$NNN_FIFO='%s')\nPlease read the documentation" "$NNN_FIFO" printf "No FIFO available! (\$NNN_FIFO='%s')\nPlease read Usage in preview-tui-ext." "$NNN_FIFO"
read -r _ cfg=$(stty -g); stty raw -echo; head -c 1; stty "$cfg"
elif [ "$KITTY_WINDOW_ID" ] && [ -z "$KITTY_LISTEN_ON" ]; then elif [ "$KITTY_WINDOW_ID" ] && [ -z "$KITTY_LISTEN_ON" ]; then
# The escape codes used to control kitty splits cause problems when run from a background process.
# Use --listen-on flag or listen_on config variable to avoid(https://sw.kovidgoyal.net/kitty/conf.html)
clear clear
printf "\$KITTY_LISTEN_ON not set!\nPlease add listen_on to your kitty.conf or start with the --listen-on flag." printf "\$KITTY_LISTEN_ON not set!\nPlease read Usage in preview-tui-ext."
read -r _ cfg=$(stty -g); stty raw -echo; head -c 1; stty "$cfg"
else else
togglepreview "$1" & togglepreview "$1" &
fi fi