1
0
Fork 0
mirror of synced 2024-12-21 22:21:08 -05:00

Bugfix: Escape quits tpm with emacs copy mode

Fixes #43, closes #45
This commit is contained in:
Bruno Sutic 2015-08-04 17:20:03 +02:00
parent 62360f9180
commit bfc7a2c2cb
No known key found for this signature in database
GPG key ID: 66D96E4F2F7EF26C
7 changed files with 36 additions and 1 deletions

View file

@ -2,6 +2,8 @@
### master ### master
- upgrade to new version of `tmux-test` - upgrade to new version of `tmux-test`
- bug: when using `emacs` copy mode, Enter does not quit screen after tpm
installation/update. Fix by making `Escape` the key for emacs mode.
### v3.0.0, 2015-08-03 ### v3.0.0, 2015-08-03
- refactor `shared_set_tpm_path_constant` function - refactor `shared_set_tpm_path_constant` function

View file

@ -1,3 +1,7 @@
_has_emacs_mode_keys() {
$(tmux show -gw mode-keys | grep -q emacs)
}
tmux_echo() { tmux_echo() {
local message="$1" local message="$1"
tmux run-shell "echo '$message'" tmux run-shell "echo '$message'"
@ -12,8 +16,13 @@ echo_err() {
} }
end_message() { end_message() {
if _has_emacs_mode_keys; then
local continue_key="ESCAPE"
else
local continue_key="ENTER"
fi
tmux_echo "" tmux_echo ""
tmux_echo "TMUX environment reloaded." tmux_echo "TMUX environment reloaded."
tmux_echo "" tmux_echo ""
tmux_echo "Done, press ENTER to continue." tmux_echo "Done, press $continue_key to continue."
} }

View file

@ -18,6 +18,7 @@ manually_install_the_plugin() {
test_plugin_uninstallation_via_tmux_key_binding() { test_plugin_uninstallation_via_tmux_key_binding() {
set_tmux_conf_helper <<- HERE set_tmux_conf_helper <<- HERE
set -g mode-keys vi
run-shell "$TPM_DIR/tpm" run-shell "$TPM_DIR/tpm"
HERE HERE
@ -33,6 +34,7 @@ test_plugin_uninstallation_via_tmux_key_binding() {
test_plugin_uninstallation_via_script() { test_plugin_uninstallation_via_script() {
set_tmux_conf_helper <<- HERE set_tmux_conf_helper <<- HERE
set -g mode-keys vi
run-shell "$TPM_DIR/tpm" run-shell "$TPM_DIR/tpm"
HERE HERE
@ -46,6 +48,7 @@ test_plugin_uninstallation_via_script() {
test_unsuccessful_plugin_uninstallation_via_script() { test_unsuccessful_plugin_uninstallation_via_script() {
set_tmux_conf_helper <<- HERE set_tmux_conf_helper <<- HERE
set -g mode-keys vi
run-shell "$TPM_DIR/tpm" run-shell "$TPM_DIR/tpm"
HERE HERE

View file

@ -15,6 +15,7 @@ source "$CURRENT_DIR/helpers/tpm.sh"
test_plugin_installation_via_tmux_key_binding() { test_plugin_installation_via_tmux_key_binding() {
set_tmux_conf_helper <<- HERE set_tmux_conf_helper <<- HERE
set -g mode-keys vi
set -g @plugin "tmux-plugins/tmux-example-plugin" set -g @plugin "tmux-plugins/tmux-example-plugin"
run-shell "$TPM_DIR/tpm" run-shell "$TPM_DIR/tpm"
HERE HERE
@ -30,6 +31,7 @@ test_plugin_installation_via_tmux_key_binding() {
test_plugin_installation_custom_dir_via_tmux_key_binding() { test_plugin_installation_custom_dir_via_tmux_key_binding() {
set_tmux_conf_helper <<- HERE set_tmux_conf_helper <<- HERE
set -g mode-keys vi
set-environment -g TMUX_PLUGIN_MANAGER_PATH '$CUSTOM_PLUGINS_DIR' set-environment -g TMUX_PLUGIN_MANAGER_PATH '$CUSTOM_PLUGINS_DIR'
set -g @plugin "tmux-plugins/tmux-example-plugin" set -g @plugin "tmux-plugins/tmux-example-plugin"
@ -48,6 +50,7 @@ test_plugin_installation_custom_dir_via_tmux_key_binding() {
test_non_existing_plugin_installation_via_tmux_key_binding() { test_non_existing_plugin_installation_via_tmux_key_binding() {
set_tmux_conf_helper <<- HERE set_tmux_conf_helper <<- HERE
set -g mode-keys vi
set -g @plugin "tmux-plugins/non-existing-plugin" set -g @plugin "tmux-plugins/non-existing-plugin"
run-shell "$TPM_DIR/tpm" run-shell "$TPM_DIR/tpm"
HERE HERE
@ -60,6 +63,7 @@ test_non_existing_plugin_installation_via_tmux_key_binding() {
test_multiple_plugins_installation_via_tmux_key_binding() { test_multiple_plugins_installation_via_tmux_key_binding() {
set_tmux_conf_helper <<- HERE set_tmux_conf_helper <<- HERE
set -g mode-keys vi
set -g @plugin "tmux-plugins/tmux-example-plugin" set -g @plugin "tmux-plugins/tmux-example-plugin"
\ \ set -g @plugin 'tmux-plugins/tmux-copycat' \ \ set -g @plugin 'tmux-plugins/tmux-copycat'
run-shell "$TPM_DIR/tpm" run-shell "$TPM_DIR/tpm"
@ -79,6 +83,7 @@ test_multiple_plugins_installation_via_tmux_key_binding() {
test_plugins_installation_from_sourced_file_via_tmux_key_binding() { test_plugins_installation_from_sourced_file_via_tmux_key_binding() {
set_tmux_conf_helper <<- HERE set_tmux_conf_helper <<- HERE
set -g mode-keys vi
source '$ADDITIONAL_CONFIG_FILE_1' source '$ADDITIONAL_CONFIG_FILE_1'
set -g @plugin 'tmux-plugins/tmux-example-plugin' set -g @plugin 'tmux-plugins/tmux-example-plugin'
run-shell "$TPM_DIR/tpm" run-shell "$TPM_DIR/tpm"
@ -101,6 +106,7 @@ test_plugins_installation_from_sourced_file_via_tmux_key_binding() {
test_plugins_installation_from_multiple_sourced_files_via_tmux_key_binding() { test_plugins_installation_from_multiple_sourced_files_via_tmux_key_binding() {
set_tmux_conf_helper <<- HERE set_tmux_conf_helper <<- HERE
set -g mode-keys vi
\ \ source '$ADDITIONAL_CONFIG_FILE_1' \ \ source '$ADDITIONAL_CONFIG_FILE_1'
source-file '$ADDITIONAL_CONFIG_FILE_2' source-file '$ADDITIONAL_CONFIG_FILE_2'
run-shell "$TPM_DIR/tpm" run-shell "$TPM_DIR/tpm"
@ -126,6 +132,7 @@ test_plugins_installation_from_multiple_sourced_files_via_tmux_key_binding() {
test_plugin_installation_via_script() { test_plugin_installation_via_script() {
set_tmux_conf_helper <<- HERE set_tmux_conf_helper <<- HERE
set -g mode-keys vi
set -g @plugin "tmux-plugins/tmux-example-plugin" set -g @plugin "tmux-plugins/tmux-example-plugin"
run-shell "$TPM_DIR/tpm" run-shell "$TPM_DIR/tpm"
HERE HERE
@ -144,6 +151,7 @@ test_plugin_installation_via_script() {
test_plugin_installation_custom_dir_via_script() { test_plugin_installation_custom_dir_via_script() {
set_tmux_conf_helper <<- HERE set_tmux_conf_helper <<- HERE
set -g mode-keys vi
set-environment -g TMUX_PLUGIN_MANAGER_PATH '$CUSTOM_PLUGINS_DIR' set-environment -g TMUX_PLUGIN_MANAGER_PATH '$CUSTOM_PLUGINS_DIR'
set -g @plugin "tmux-plugins/tmux-example-plugin" set -g @plugin "tmux-plugins/tmux-example-plugin"
@ -165,6 +173,7 @@ test_plugin_installation_custom_dir_via_script() {
test_non_existing_plugin_installation_via_script() { test_non_existing_plugin_installation_via_script() {
set_tmux_conf_helper <<- HERE set_tmux_conf_helper <<- HERE
set -g mode-keys vi
set -g @plugin "tmux-plugins/non-existing-plugin" set -g @plugin "tmux-plugins/non-existing-plugin"
run-shell "$TPM_DIR/tpm" run-shell "$TPM_DIR/tpm"
HERE HERE
@ -178,6 +187,7 @@ test_non_existing_plugin_installation_via_script() {
test_multiple_plugins_installation_via_script() { test_multiple_plugins_installation_via_script() {
set_tmux_conf_helper <<- HERE set_tmux_conf_helper <<- HERE
set -g mode-keys vi
set -g @plugin "tmux-plugins/tmux-example-plugin" set -g @plugin "tmux-plugins/tmux-example-plugin"
\ \ set -g @plugin 'tmux-plugins/tmux-copycat' \ \ set -g @plugin 'tmux-plugins/tmux-copycat'
run-shell "$TPM_DIR/tpm" run-shell "$TPM_DIR/tpm"
@ -200,6 +210,7 @@ test_multiple_plugins_installation_via_script() {
test_plugins_installation_from_sourced_file_via_script() { test_plugins_installation_from_sourced_file_via_script() {
set_tmux_conf_helper <<- HERE set_tmux_conf_helper <<- HERE
set -g mode-keys vi
source '$ADDITIONAL_CONFIG_FILE_1' source '$ADDITIONAL_CONFIG_FILE_1'
set -g @plugin 'tmux-plugins/tmux-example-plugin' set -g @plugin 'tmux-plugins/tmux-example-plugin'
run-shell "$TPM_DIR/tpm" run-shell "$TPM_DIR/tpm"
@ -225,6 +236,7 @@ test_plugins_installation_from_sourced_file_via_script() {
test_plugins_installation_from_multiple_sourced_files_via_script() { test_plugins_installation_from_multiple_sourced_files_via_script() {
set_tmux_conf_helper <<- HERE set_tmux_conf_helper <<- HERE
set -g mode-keys vi
\ \ source '$ADDITIONAL_CONFIG_FILE_1' \ \ source '$ADDITIONAL_CONFIG_FILE_1'
source-file '$ADDITIONAL_CONFIG_FILE_2' source-file '$ADDITIONAL_CONFIG_FILE_2'
set -g @plugin 'tmux-plugins/tmux-example-plugin' set -g @plugin 'tmux-plugins/tmux-example-plugin'

View file

@ -11,6 +11,7 @@ source "$CURRENT_DIR/helpers/tpm.sh"
test_plugin_installation_via_tmux_key_binding() { test_plugin_installation_via_tmux_key_binding() {
set_tmux_conf_helper <<- HERE set_tmux_conf_helper <<- HERE
set -g mode-keys vi
set -g @tpm_plugins "tmux-plugins/tmux-example-plugin" set -g @tpm_plugins "tmux-plugins/tmux-example-plugin"
run-shell "$TPM_DIR/tpm" run-shell "$TPM_DIR/tpm"
HERE HERE
@ -28,6 +29,7 @@ test_plugin_installation_via_tmux_key_binding() {
test_legacy_and_new_syntax_for_plugin_installation_work_via_tmux_key_binding() { test_legacy_and_new_syntax_for_plugin_installation_work_via_tmux_key_binding() {
set_tmux_conf_helper <<- HERE set_tmux_conf_helper <<- HERE
set -g mode-keys vi
set -g @tpm_plugins " \ set -g @tpm_plugins " \
tmux-plugins/tmux-example-plugin \ tmux-plugins/tmux-example-plugin \
" "
@ -53,6 +55,7 @@ test_legacy_and_new_syntax_for_plugin_installation_work_via_tmux_key_binding() {
test_plugin_installation_via_script() { test_plugin_installation_via_script() {
set_tmux_conf_helper <<- HERE set_tmux_conf_helper <<- HERE
set -g mode-keys vi
set -g @tpm_plugins "tmux-plugins/tmux-example-plugin" set -g @tpm_plugins "tmux-plugins/tmux-example-plugin"
run-shell "$TPM_DIR/tpm" run-shell "$TPM_DIR/tpm"
HERE HERE
@ -71,6 +74,7 @@ test_plugin_installation_via_script() {
test_legacy_and_new_syntax_for_plugin_installation_work_via_script() { test_legacy_and_new_syntax_for_plugin_installation_work_via_script() {
set_tmux_conf_helper <<- HERE set_tmux_conf_helper <<- HERE
set -g mode-keys vi
set -g @tpm_plugins " \ set -g @tpm_plugins " \
tmux-plugins/tmux-example-plugin \ tmux-plugins/tmux-example-plugin \
" "

View file

@ -33,6 +33,7 @@ check_tpm_path() {
test_plugin_sourcing() { test_plugin_sourcing() {
set_tmux_conf_helper <<- HERE set_tmux_conf_helper <<- HERE
set -g mode-keys vi
set -g @plugin "doesnt_matter/tmux_test_plugin" set -g @plugin "doesnt_matter/tmux_test_plugin"
run-shell "$TPM_DIR/tpm" run-shell "$TPM_DIR/tpm"
HERE HERE
@ -51,6 +52,7 @@ test_plugin_sourcing() {
test_default_tpm_path() { test_default_tpm_path() {
set_tmux_conf_helper <<- HERE set_tmux_conf_helper <<- HERE
set -g mode-keys vi
run-shell "$TPM_DIR/tpm" run-shell "$TPM_DIR/tpm"
HERE HERE
@ -62,6 +64,7 @@ test_default_tpm_path() {
test_custom_tpm_path() { test_custom_tpm_path() {
set_tmux_conf_helper <<- HERE set_tmux_conf_helper <<- HERE
set -g mode-keys vi
set-environment -g TMUX_PLUGIN_MANAGER_PATH '$CUSTOM_PLUGINS_DIR' set-environment -g TMUX_PLUGIN_MANAGER_PATH '$CUSTOM_PLUGINS_DIR'
run-shell "$TPM_DIR/tpm" run-shell "$TPM_DIR/tpm"
HERE HERE

View file

@ -17,6 +17,7 @@ manually_install_the_plugin() {
test_plugin_update_via_tmux_key_binding() { test_plugin_update_via_tmux_key_binding() {
set_tmux_conf_helper <<- HERE set_tmux_conf_helper <<- HERE
set -g mode-keys vi
set -g @plugin "tmux-plugins/tmux-example-plugin" set -g @plugin "tmux-plugins/tmux-example-plugin"
run-shell "$TPM_DIR/tpm" run-shell "$TPM_DIR/tpm"
HERE HERE
@ -36,6 +37,7 @@ test_plugin_update_via_tmux_key_binding() {
test_plugin_update_via_script() { test_plugin_update_via_script() {
set_tmux_conf_helper <<- HERE set_tmux_conf_helper <<- HERE
set -g mode-keys vi
set -g @plugin "tmux-plugins/tmux-example-plugin" set -g @plugin "tmux-plugins/tmux-example-plugin"
run-shell "$TPM_DIR/tpm" run-shell "$TPM_DIR/tpm"
HERE HERE