Outputting hyperlinks in the terminal can mangle the tab title
Thanks for filing an issue! Please answer the questions below so I can help you.
- iTerm2 version: 3.3.12
- OS version: macOS Catalina 10.15.2
- Attach ~/Library/Preferences/com.googlecode.iterm2.plist here (drag-drop from finder into this window)
- Attach a debug log, if possible. Instructions at https://iterm2.com/debuglog
- Attach a screen capture video if it would make the reproduction steps clearer.
Are you reporting a performance issue, excessive CPU usage, or a hang? Please attach a sample. Instructions at https://gitlab.com/gnachman/iterm2/wikis/HowToSampleAre you reporting a crash? Please attach the crash log. Instructions at https://gitlab.com/gnachman/iterm2/wikis/crash-logsAre you reporting excessive memory usage? Please attach a heap analysis: https://gitlab.com/gnachman/iterm2/wikis/heapshot
PLEASE ATTACH YOUR PLIST FILE FOR BUG REPORTS! Seriously! I'll probably ask you for it if you don’t.
Detailed steps to reproduce the problem:
- Configure the terminal to allow scripts to change the title
- Set the title to something
- Output a lot of hyperlinks
- Observe that the title gets mangled
Here's a short script that consistently reproduces the issue for me. It sometimes takes a couple of runs before it happens.
echo -ne "\033]0;original title\007" && for i in {0..100}; do echo -ne '\e]8;;https://example.com/a/b/c/-/d/e/f\e\\example/hyperlink/with/slashes\e]8;;\e\\ '; done
What happened:
In certain contexts where script output includes a lot of ansi magic (colors, hyperlinks, etc), the title gets mangled, even if the ansi magic did not include the escape sequence to change the title.
One example of where I see this a lot is with output from jest
(the node testing framework).
What should have happened:
The title should not be affected, since the title change escape sequence is not being encountered.