mirror of
1
0
Fork 0

always use grep -E for regular expression and unset GREP_OPTIONS, fixes #252

This commit is contained in:
Gregory Pakosz 2019-06-22 14:23:26 +02:00
parent 685c74128e
commit d2df5cf4d4
1 changed files with 9 additions and 8 deletions

View File

@ -175,6 +175,7 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# # exit the script if any statement returns a non-true return value
# set -e
#
# unset GREP_OPTIONS
# export LC_NUMERIC=C
#
# if ! printf '' | sed -E 's///' 2>/dev/null; then
@ -226,7 +227,7 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# current_session=${1:-$(tmux display -p '#{session_name}')}
# current_pane=${2:-$(tmux display -p '#{pane_id}')}
#
# dead_panes=$(tmux list-panes -s -t "$current_session" -F '#{pane_dead} #{pane_id} #{pane_start_command}' | grep -o '^1 %.\+maximized.\+$' || true)
# dead_panes=$(tmux list-panes -s -t "$current_session" -F '#{pane_dead} #{pane_id} #{pane_start_command}' | grep -E -o '^1 %.+maximized.+$' || true)
# restore=$(echo "$dead_panes" | sed -n -E -e "s/^1 $current_pane .+maximized.+'(%[0-9]+)'$/tmux swap-pane -s \1 -t $current_pane \; kill-pane -t $current_pane/p" -e "s/^1 (%[0-9]+) .+maximized.+'$current_pane'$/tmux swap-pane -s \1 -t $current_pane \; kill-pane -t \1/p" )
#
# if [ -z "$restore" ]; then
@ -688,7 +689,7 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# fi
# eval "tmux $left $right" 2>/dev/null || true
# done << EOF
# $(tmux list-keys 2>/dev/null | grep -e 'new-window\(\s\+-c\s\+"#{pane_current_path}\|$\)')
# $(tmux list-keys 2>/dev/null | grep -E 'new-window(\s+-c\s+"#{pane_current_path}"|$)')
# EOF
#
# tmux_conf_new_pane_retain_current_path=${tmux_conf_new_pane_retain_current_path:-true}
@ -702,7 +703,7 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# fi
# eval "tmux $left $right" 2>/dev/null || true
# done << EOF
# $(tmux list-keys 2>/dev/null | grep -e 'split\(-\|_\)window')
# $(tmux list-keys 2>/dev/null | grep -E 'split(-|_)window')
# EOF
#
# tmux_conf_new_pane_reconnect_ssh=${tmux_conf_new_pane_reconnect_ssh:-false}
@ -716,7 +717,7 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# fi
# eval "tmux $left $right" 2>/dev/null || true
# done << EOF
# $(tmux list-keys 2>/dev/null | grep -e 'split\(-\|_\)window')
# $(tmux list-keys 2>/dev/null | grep -E 'split(-|_)window')
# EOF
#
# tmux_conf_new_session_prompt=${tmux_conf_new_session_prompt:-false}
@ -730,7 +731,7 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# fi
# eval "tmux $left $right" 2>/dev/null || true
# done << EOF
# $(tmux list-keys 2>/dev/null | grep -e 'new-session')
# $(tmux list-keys 2>/dev/null | grep 'new-session')
# EOF
#
# tmux_conf_copy_to_os_clipboard=${tmux_conf_copy_to_os_clipboard:-false}
@ -744,7 +745,7 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# if [ -n "$command" ]; then
# # shellcheck disable=SC2086
# for table in "" "-t emacs-copy" "-t vi-copy"; do
# line=$(tmux list-keys $table 2>/dev/null | grep -e 'copy-selection\|copy-pipe' | head -1)
# line=$(tmux list-keys $table 2>/dev/null | grep -E 'copy-selection|copy-pipe' | head -1)
# [ -z "$line" ] && continue
# prefix=${line%copy-*}
# column=${#prefix}
@ -759,7 +760,7 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# fi
# eval "tmux $left $right" 2>/dev/null || true
# done << EOF
# $(tmux list-keys $table 2>/dev/null | grep -e 'copy-selection\|copy-pipe')
# $(tmux list-keys $table 2>/dev/null | grep -E 'copy-selection|copy-pipe')
# EOF
# done
# fi
@ -1199,7 +1200,7 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# _apply_overrides
# _apply_bindings
# _apply_theme
# for name in $(printenv | grep -Eo '^tmux_conf_[^=]+'); do tmux setenv -gu "$name"; done;
# for name in $(printenv | grep -E -o '^tmux_conf_[^=]+'); do tmux setenv -gu "$name"; done;
# }
#
# _urlview() {