diff --git a/install.sh b/install.sh index aa3a668..a2e8e49 100755 --- a/install.sh +++ b/install.sh @@ -39,14 +39,3 @@ tmux set-environment -g TMUX_PLUGIN_MANAGER_PATH "~/.tmux/plugins" tmux kill-session -t __noop >/dev/null 2>&1 || true printf "$(tput setaf 2)OK:$(tput sgr0) Completed\n" - - - - - - - - - - - diff --git a/tmux/tmux.conf b/tmux/tmux.conf index 335639f..dff1185 100644 --- a/tmux/tmux.conf +++ b/tmux/tmux.conf @@ -68,6 +68,9 @@ bind C-r source-file ~/.tmux.conf \; display "Config reloaded" # new window and retain cwd bind c new-window -c "#{pane_current_path}" +# Prompt to rename window right after it's created +set-hook -g after-new-window 'command-prompt -I "#{window_name}" "rename-window '%%'"' + # Rename session and window bind r command-prompt -I "#{window_name}" "rename-window '%%'" bind R command-prompt -I "#{session_name}" "rename-session '%%'" @@ -118,6 +121,8 @@ bind D if -F '#{session_many_attached}' \ # Hide status bar on demand bind C-s if -F '#{s/off//:status}' 'set status off' 'set status on' + + # ================================================== # === Window monitoring for activity and silence === # ================================================== @@ -139,6 +144,8 @@ set -g visual-activity on # ================================================ # === Copy mode, scroll and clipboard === # ================================================ +set -g @copy_use_osc52_fallback on + # Prefer vi style key table setw -g mode-keys vi diff --git a/tmux/yank.sh b/tmux/yank.sh index 653cc05..6450e8e 100755 --- a/tmux/yank.sh +++ b/tmux/yank.sh @@ -10,6 +10,7 @@ is_app_installed() { buf=$(cat "$@") copy_backend_remote_tunnel_port=$(tmux show-option -gvq "@copy_backend_remote_tunnel_port") +copy_use_osc52_fallback=$(tmux show-option -gvq "@copy_use_osc52_fallback") # Resolve copy backend: pbcopy (OSX), reattach-to-user-namespace (OSX), xclip/xsel (Linux) copy_backend="" @@ -31,7 +32,13 @@ if [ -n "$copy_backend" ]; then exit; fi -# If no copy backends were eligible, fallback to OSC 52 escape sequences + +# If no copy backends were eligible, decide to fallback to OSC 52 escape sequences +# Note, most terminals do not handle OSC +if [ "$copy_use_osc52_fallback" == "off" ]; then + exit; +fi + # Copy via OSC 52 ANSI escape sequence to controlling terminal buflen=$( printf %s "$buf" | wc -c )