dynamic-colors
dynamic-colors copied to clipboard
Breaks when run in tmux with run-shell command
In a tmux session I can run commands in the background of an active pane using the run-shell tmux command.
i.e.
:run-shell "echo hi"
outputs hi correctly.
When running ~/.dynamic-colors/bin/dynamic-colors switch solarized-dark in a tmux shell, it works fine as well.
However, when you don't have an interactive command prompt in a tmux session (i.e. when you run a long-running command like irssi in tmux) you need to use the run-shell tmux command.
But using run-shell breaks dynamic-colors. When I run the tmux command:
:run-shell "~/.dynamic-colors/bin/dynamic-colors switch solarized-dark"
I get this output in tmux:
Ptmux;]11;#002b36\Ptmux;]10;#839496\Ptmux;]12;#93a1a1\Ptmux;]14;#073642\Ptmux;]13;#93a1a1\Ptmux;]17;#073642\Ptmux;]708;#002b36\Ptmux;]4;0;#073642\Ptmux;]4;1;#dc322f[0/0]
x;]4;2;#859900\Ptmux;]4;3;#b58900\Ptmux;]4;4;#268bd2\Ptmux;]4;5;#d33682\Ptmux;]4;6;#2aa198\Ptmux;]4;7;#eee8d5\Ptmux;]4;8;#002b36\Ptmux;]4;9;#cb4b16\Ptmux;]4;10;#586e75\P
tmux;]4;11;#657b83\Ptmux;]4;12;#839496\Ptmux;]4;13;#6c71c4\Ptmux;]4;14;#93a1a1\Ptmux;]4;15;#fdf6e3\
Btw, this happens regardless of my termial, I tried with termite, xterm and urxvt, all produce the same issue.
There is no workaround for run-shell, because tmux discards any escape characters in it (as well as most other control characters). Source