diff --git a/private_dot_config/private_fish/functions/private___tide_terminal_osc_background.fish b/private_dot_config/private_fish/functions/private___tide_terminal_osc_background.fish index ac297d3..42a0388 100644 --- a/private_dot_config/private_fish/functions/private___tide_terminal_osc_background.fish +++ b/private_dot_config/private_fish/functions/private___tide_terminal_osc_background.fish @@ -9,11 +9,16 @@ function __tide_terminal_osc_background \ status is-interactive or return 1 - # tmux and screen both need the query wrapped, and each wants it wrapped - # differently. Leave those to the caller's config-file path instead of - # guessing wrong and eating the user's keystrokes waiting for a reply. - set -q TMUX - and return 1 + # tmux needs no special handling: it answers OSC 11 from a pane itself, out + # of the background it queried from the outer terminal, and it re-queries + # when that terminal reports a colour scheme change -- so the answer tracks + # the real window. Do not reach for the \ePtmux; passthrough wrapper here: + # that is output-only, the reply goes to tmux rather than to this pane, and + # the query then times out having achieved nothing. + # + # screen is left out because it is untested rather than known broken; there + # the caller falls back to reading the config files, as it did everywhere + # before this query existed. string match -q 'screen*' -- "$TERM" and return 1 diff --git a/private_dot_config/private_fish/private_tests/private_verify_tide_terminal_events.exp b/private_dot_config/private_fish/private_tests/private_verify_tide_terminal_events.exp index 4613cd4..39f8cb0 100644 --- a/private_dot_config/private_fish/private_tests/private_verify_tide_terminal_events.exp +++ b/private_dot_config/private_fish/private_tests/private_verify_tide_terminal_events.exp @@ -18,9 +18,17 @@ set path_label "direct" set through_tmux 0 set mode [expr {[llength $argv] > 0 ? [lindex $argv 0] : "direct"}] -if {$mode eq "tmux"} { - set path_label "tmux" +if {$mode eq "tmux" || $mode eq "remote-tmux"} { + set path_label $mode set through_tmux 1 + if {$mode eq "remote-tmux"} { + # The ssh-inside-tmux case. tmux answers OSC 11 from a pane out of the + # background it holds for the outer terminal, so the query works here + # with no wrapping -- but only if nothing opts out of asking. + set kitty_config [file join $fixtures kitty-remote-dark] + set light_reply "ebeb/e8e8/e4e4" + set light_segment "DFDCD8" + } spawn env TERM=xterm-kitty KITTY_CONFIG_DIRECTORY=$kitty_config \ tmux -L tide-appearance-test \ -f "$env(HOME)/.tmux.conf" new-session fish --interactive