Add nested tmux escape sequence for bash prompt tracking#552
Conversation
The single tmux instances are unaffected by the change. The implementation uses the single quote to simplify the escaping of backslashes (avoid doubling them) and replaces the octal value of the bell sequence (\007) with the corresponding C escape sequence (\a) for uniformity with ESC (\033 or \e).
|
Thanks for your PR. Is there a reason to prefer the "simple" method as opposed to the one that works for nested sessions as well? |
Thanks for the feedback. You it the pain point... I do not know why the nested escape also works in the simple session (I was surprised!). I hope that this is by the desing of tmux and not by an accident (tested in tmux 3.1c). I left the simple implementation as documentation/workaround if some tmux version/build will raise warning or errors. By looking at tmux source code (quickly) I did not found any relevant test/regression about nested escapes. If you prefer to be safe than sorry we need to check/add proper escape sequence testing in tmux. At this time I do not know if this is worth the effort and in the scope here. What do you think? |
|
I don't know much about tmux, but we should definitely ensure that the same behavior is available for zsh and fish as well (ie, we should also edit the corresponding files). If everything is consistent, we can merge this, leaving a descriptive comment. The comment should explain why one might want to use the simple version (which is more or less what you wrote in the last message). Thanks. |
|
Thanks for the quick feedback loop, I will try to add some tests and then add/refactor the shell code. |
9a6dbeb to
a2f2286
Compare
The single tmux instances are unaffected by the change.
The implementation uses the single quote to simplify the escaping of
backslashes (avoid doubling them) and replaces the octal value of the
bell sequence (\007) with the corresponding C escape sequence (\a) for
uniformity with ESC (\033 or \e).