1
0
Fork 0
mirror of synced 2024-11-17 23:15:35 -05:00

fixed <prefix>+e not working when EDITOR is not defined in sh (2), fixes #755

This commit is contained in:
Gregory Pakosz 2024-08-13 10:03:45 +02:00
parent 49e1bdfa93
commit 5f1047550b

View file

@ -28,7 +28,12 @@ setw -q -g utf8 on
set -g history-limit 5000 # boost history
# edit configuration
%if #{>=:#{version},3.0}
bind e new-window -n "#{TMUX_CONF_LOCAL}" -e EDITOR="$EDITOR" sh -c 'case "${EDITOR:-vim}" in *vim*) ${EDITOR:-vim} -c ":set syntax=tmux" "$TMUX_CONF_LOCAL";; *) $EDITOR "$TMUX_CONF_LOCAL";; esac && "$TMUX_PROGRAM" ${TMUX_SOCKET:+-S "$TMUX_SOCKET"} source "$TMUX_CONF" \; display "$TMUX_CONF_LOCAL sourced"'
%else
set-environment -g EDITOR "$EDITOR"
bind e new-window -n "#{TMUX_CONF_LOCAL}" sh -c 'case "${EDITOR:-vim}" in *vim*) ${EDITOR:-vim} -c ":set syntax=tmux" "$TMUX_CONF_LOCAL";; *) $EDITOR "$TMUX_CONF_LOCAL";; esac && "$TMUX_PROGRAM" ${TMUX_SOCKET:+-S "$TMUX_SOCKET"} source "$TMUX_CONF" \; display "$TMUX_CONF_LOCAL sourced"'
%endif
# reload configuration
bind r run '"$TMUX_PROGRAM" ${TMUX_SOCKET:+-S "$TMUX_SOCKET"} source "$TMUX_CONF"' \; display "#{TMUX_CONF} sourced"