From 34a980fb9f9a76d137805e0d9cc15d3b11ef57de Mon Sep 17 00:00:00 2001 From: Akemi Izuko Date: Sat, 23 Dec 2023 20:13:52 -0700 Subject: [PATCH] Support backgrounding ascii in vifm + tmux --- vifm/scripts/vifm_bg_open.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vifm/scripts/vifm_bg_open.sh b/vifm/scripts/vifm_bg_open.sh index 0d211d3..0c5a436 100755 --- a/vifm/scripts/vifm_bg_open.sh +++ b/vifm/scripts/vifm_bg_open.sh @@ -29,6 +29,12 @@ open_file() { html) chromium "$1" &>/dev/null & ;; + *) + if [[ -n "$TMUX" ]] && file "$1" | grep -iq 'ascii'; then + tmux new-window -c "#{pane_current_path}" + sleep .2 # Let bash login, otherwise command won't get sent + tmux send-keys "vi $1" Enter + fi esac }