Skip to content
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

Support title from xterm.js #22325

Closed
Tyriar opened this issue Mar 9, 2017 · 7 comments
Closed

Support title from xterm.js #22325

Tyriar opened this issue Mar 9, 2017 · 7 comments
Assignees
Labels
feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities insiders-released Patch has been released in VS Code Insiders linux Issues with VS Code on Linux macos Issues with VS Code on MAC/OS X on-release-notes Issue/pull request mentioned in release notes terminal Integrated terminal issues verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented Mar 9, 2017

From @pharmmd-rich in #22319

The dropdown list currently displays a list of processes, however, I like giving my terminals custom names in OS-X. The drop down list does not appear to honor these names. (they are set using: printf '\033]0;title\007'".

Open to PRs, we will want to handle xterm.on('title', listener) inside TerminalInstance and use that over the pty name if it's set. Currently I'm assuming this will only fire if the user has set up a title they want to use, whether of not the event is guarenteed to fire on new terminals might change my thinking on how it works.

@Tyriar Tyriar added feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities terminal Integrated terminal issues labels Mar 9, 2017
@Tyriar Tyriar self-assigned this Mar 9, 2017
@Tyriar
Copy link
Member Author

Tyriar commented May 15, 2017

@Lixire here's one of the PRs with some extra detail in what needs to happen #22454 (comment)

@Lixire Lixire removed their assignment Aug 24, 2017
@Tyriar Tyriar added macos Issues with VS Code on MAC/OS X linux Issues with VS Code on Linux labels Sep 17, 2018
Tyriar added a commit that referenced this issue Aug 20, 2019
This lets you use \[\033]0;\w\a\] in PS1 to set the dropdown value to the cwd for example

Part of #22325
@Tyriar
Copy link
Member Author

Tyriar commented Aug 20, 2019

Just added a new setting for this, set:

"terminal.integrated.experimentalUseTitleEvent": true

To use the title from the VT sequence.

@dee-kryvenko
Copy link

dee-kryvenko commented Aug 25, 2019

@Tyriar thanks a lot! I just tried it, and it seems that it works, with a little issue though.
So I usually right click on a sub-folder and choose Open in Terminal. When I do that with experimentalUseTitleEvent enabled, the title automatically set to 1: /bin/bash. But if I cd . it will properly update the title after changing the directory.

Version: 1.38.0-insider
Commit: 0f73473c08055054f317c1c94502f7f39fdbb164
Date: 2019-08-23T05:36:33.571Z
Electron: 4.2.9
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Darwin x64 18.7.0

UPD: I just tried it on 1.38.0, same behavior is reproducible there.

@Tyriar
Copy link
Member Author

Tyriar commented Sep 6, 2019

Sounds like the first event isn't getting fired, should get fixed before we remove experimental.

@Tyriar Tyriar added this to the Backlog milestone Oct 26, 2019
@cr4ckm3
Copy link

cr4ckm3 commented Feb 26, 2020

Also it shows whole path with user@userdomain, would be perfect if I can choose to show only last folder name or set in workspace config the name of the terminal. Thanks a lot!

@dee-kryvenko
Copy link

I've been using vscode on Mac OS Mojave with bash and it seems to be working as @cr4ckm3 described (dropdown name is an equivalent of basename $(pwd)). I just upgraded to Catalina where they made zsh a default shell and I decided to give it a shot. With zsh it uses ${whoami}@${hostname} $(print -rD $PWD), which is too long and the only visible part is username+hostname so I couldn't tell which terminal I'm looking at right away without clicking on dropdown to see expanded list.

@Tyriar
Copy link
Member Author

Tyriar commented May 20, 2021

The setting is now titleMode in the upcoming Insiders release

@Tyriar Tyriar modified the milestones: Backlog, May 2021 May 20, 2021
@Tyriar Tyriar added the verification-needed Verification of issue is requested label May 27, 2021
@connor4312 connor4312 added the verified Verification succeeded label Jun 2, 2021
@Tyriar Tyriar added the on-release-notes Issue/pull request mentioned in release notes label Jun 3, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jul 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities insiders-released Patch has been released in VS Code Insiders linux Issues with VS Code on Linux macos Issues with VS Code on MAC/OS X on-release-notes Issue/pull request mentioned in release notes terminal Integrated terminal issues verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
6 participants
@dee-kryvenko @Tyriar @connor4312 @cr4ckm3 @Lixire and others