-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to set terminal tab name programmatically and not to reset it with ANSI command #494
Comments
@mmx85 your proposal sounds great and I look forward to reviewing and merging such a change. |
When a more complete implementation of ANSI Escape sequence for renaming terminal titles was added in [CDT 10.2](https://github.com/eclipse-cdt/cdt/blob/main/NewAndNoteworthy/CDT-10.2.md#rename-terminal-tab) it caused a regression in use cases where extenders of the terminal wanted to retain control of the terminal's title. This commit adds a new flag that will prevent the title of the terminal tab from being updated from ANSI escape sequences. Fixes eclipse-cdt#494
When a more complete implementation of ANSI Escape sequence for renaming terminal titles was added in [CDT 10.2](https://github.com/eclipse-cdt/cdt/blob/main/NewAndNoteworthy/CDT-10.2.md#rename-terminal-tab) it caused a regression in use cases where extenders of the terminal wanted to retain control of the terminal's title. This commit adds a new flag that will prevent the title of the terminal tab from being updated from ANSI escape sequences. Fixes #494
Thank you @mmx85 for this improvement. |
When a more complete implementation of ANSI Escape sequence for renaming terminal titles was added in [CDT 10.2](https://github.com/eclipse-cdt/cdt/blob/main/NewAndNoteworthy/CDT-10.2.md#rename-terminal-tab) it caused a regression in use cases where extenders of the terminal wanted to retain control of the terminal's title. This commit adds a new flag that will prevent the title of the terminal tab from being updated from ANSI escape sequences. Fixes eclipse-cdt#494
After updating I get following exception when opening a terminal in eclipse, which I think is related to this issue: |
Thanks @hloehnert for raising this and identifying the likely point it regressed from. To make sure it doesn't get lost I started a new issue #617 |
Discussed in #492
Originally posted by mmx85 August 4, 2023
I have the code that setups terminal and opens it with custom tab name after some user actions. It looks like this:
HashMap<String, Object> params = new HashMap<String, Object>();
params.put(ITerminalsConnectorConstants.PROP_TITLE, "some name"));
params.put(ITerminalsConnectorConstants.PROP_DELEGATE_ID, delegateId);
params.put(ITerminalsConnectorConstants.PROP_PROCESS_PATH, bashShellExecutablePath);
params.put(ITerminalsConnectorConstants.PROP_PROCESS_WORKING_DIR, workingDir);
...
TerminalServiceFactory.getService().openConsole(params, null);
It worked well for me with CDT 10.0.
After updating to CDT 10.2 and higher the code above sets the correct name but VT100Emulator.processNewText() overrides it reading a startup sequence that Bash outputs with ANSI command to change terminal title to current working directory value. When VT100Emulator reads this command it overrides terminal tab title with current working directory value calling: processNewText()->processAnsiOsCommand()->terminal.setTerminalTitle(ansiOsCommand.substring(2)) in VT100Emulator class.
This regression is cased by the following changes: https://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=fe003208544902646096db658f63d2038a80d40a
I need to have ability to keep the value that is set with ITerminalsConnectorConstants.PROP_TITLE parameter regardless what is set with "\e]0;...\u0007" ANSI command and when but this does not meant that feature that caused regression should be reverted or something like this.
I propose to add a ITerminalsConnectorConstants.PROP_TITLE_UPDATE constant with options:
The text was updated successfully, but these errors were encountered: