mirror of
https://github.com/jarun/nnn.git
synced 2024-11-04 18:33:12 +00:00
Merge pull request #951 from luukvbaal/preview-tui-ext
preview-tui-ext: pass env
This commit is contained in:
commit
c49f24c696
|
@ -168,7 +168,7 @@ preview_file() {
|
||||||
if [ -d "$1" ]; then
|
if [ -d "$1" ]; then
|
||||||
cd "$1" || return
|
cd "$1" || return
|
||||||
if exists tree; then
|
if exists tree; then
|
||||||
if [ "$ICONLOOKUP" -ne 0 ]; then
|
if [ "$ICONLOOKUP" -ne 0 ] && [ -f "$(dirname "$0")"/.iconlookup ]; then
|
||||||
[ "$SPLIT" = h ] && BSTR="\n"
|
[ "$SPLIT" = h ] && BSTR="\n"
|
||||||
tree -L 1 --dirsfirst -F --noreport -i | head -n "$((lines - 3))" | "$(dirname "$0")"/.iconlookup -l "$cols" -B "$BSTR" -b " "
|
tree -L 1 --dirsfirst -F --noreport -i | head -n "$((lines - 3))" | "$(dirname "$0")"/.iconlookup -l "$cols" -B "$BSTR" -b " "
|
||||||
else
|
else
|
||||||
|
@ -183,7 +183,7 @@ preview_file() {
|
||||||
if [ "${mimetype%%/*}" = "image" ]; then
|
if [ "${mimetype%%/*}" = "image" ]; then
|
||||||
if [ "${mimetype#*/}" = "gif" ] && exists convert; then
|
if [ "${mimetype#*/}" = "gif" ] && exists convert; then
|
||||||
generate_preview "$cols" "$lines" "$1" "gif"
|
generate_preview "$cols" "$lines" "$1" "gif"
|
||||||
elif [ ! "${mimetype#*/}" = "jpeg" ]; then
|
elif [ "${mimetype#*/}" != "jpeg" ]; then
|
||||||
generate_preview "$cols" "$lines" "$1" "image"
|
generate_preview "$cols" "$lines" "$1" "image"
|
||||||
else
|
else
|
||||||
image_preview "$cols" "$lines" "$1"
|
image_preview "$cols" "$lines" "$1"
|
||||||
|
@ -366,7 +366,9 @@ if [ "$TERMINAL" = "tmux" ]; then
|
||||||
# tmux splits are inverted
|
# tmux splits are inverted
|
||||||
if [ "$SPLIT" = "v" ]; then SPLIT="h"; else SPLIT="v"; fi
|
if [ "$SPLIT" = "v" ]; then SPLIT="h"; else SPLIT="v"; fi
|
||||||
|
|
||||||
tmux split-window -e "NNN_FIFO=$NNN_FIFO" -e "PREVIEW_MODE=1" -e "SPLIT=$SPLIT" -d"$SPLIT" "$0" "$1"
|
tmux split-window -e "NNN_FIFO=$NNN_FIFO" -e "PREVIEW_MODE=1" -e "PAGER=$PAGER" \
|
||||||
|
-e "USE_SCOPE=$USE_SCOPE" -e "SPLIT=$SPLIT" -e "USE_PISTOL=$USE_PISTOL" \
|
||||||
|
-e "ICONLOOKUP=$ICONLOOKUP" -d"$SPLIT" "$0" "$1"
|
||||||
elif [ "$TERMINAL" = "kitty" ]; then
|
elif [ "$TERMINAL" = "kitty" ]; then
|
||||||
# Setting the layout for the new window. It will be restored after the
|
# Setting the layout for the new window. It will be restored after the
|
||||||
# script ends.
|
# script ends.
|
||||||
|
@ -379,7 +381,7 @@ elif [ "$TERMINAL" = "kitty" ]; then
|
||||||
--cwd "$PWD" --env "PATH=$PATH" --env "NNN_FIFO=$NNN_FIFO" \
|
--cwd "$PWD" --env "PATH=$PATH" --env "NNN_FIFO=$NNN_FIFO" \
|
||||||
--env "PREVIEW_MODE=1" --env "PAGER=$PAGER" \
|
--env "PREVIEW_MODE=1" --env "PAGER=$PAGER" \
|
||||||
--env "USE_SCOPE=$USE_SCOPE" --env "SPLIT=$SPLIT" \
|
--env "USE_SCOPE=$USE_SCOPE" --env "SPLIT=$SPLIT" \
|
||||||
--env "USE_PISTOL=$USE_PISTOL" \
|
--env "USE_PISTOL=$USE_PISTOL" --env "ICONLOOKUP=$ICONLOOKUP" \
|
||||||
--location "${SPLIT}split" "$0" "$1" >/dev/null
|
--location "${SPLIT}split" "$0" "$1" >/dev/null
|
||||||
else
|
else
|
||||||
PREVIEW_MODE=1 $TERMINAL -e "$0" "$1" &
|
PREVIEW_MODE=1 $TERMINAL -e "$0" "$1" &
|
||||||
|
|
Loading…
Reference in a new issue