-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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 runtime variables in the custom user title #1320
Comments
Do we really want that? Would we then have to update it constantly? What if users just set the title themselves using VT sequences, and we made information like that available in environment variables or via VT query responses ... |
@Jaykul if I could have convinced people that the VT title was all they needed, we wouldn’t have had a forty-comment-long discussion in #608 and a followup deliverable :( The moment they get that, they’ll complain that they’re not seeing their application title :p |
Yeah, I'll help fight it there too 🙄 what we need is education, not configuration. |
The reason I want this feature is not because I don't know how to set the title from the console, but because the scripts that I run as part of my job keep changing the title. What's worse is these scripts don't know anything about tabbed console windows, so they set the title to something super long. I want much more control over the tab titles, regardless of what scripts try to do to them. When I use Terminal I will have many tabs open at a time, and I'd like each of the tab titles to be very concise so I can see as many tabs as possible without scrolling. This means being able to strip the "Administrator:" prefix to all of the tabs. (I'd much rather have the administrator status represented by the tab color or something else that doesn't take up valuable space in the tabs.) It would also be most helpful for the tab title to also tell me which tab number it is so I can quickly know which hotkey to use to change to that tab. The ideal would be for Terminal to let me provide a regular expression for extracting the most important parts of what the console app wants the title to be so I can have it display the most important information in the actual title, including whether or not the script I started in that tab is still running (to be represented in the tab by a single character, not a long string of text set by the script). |
Well, the VT title just lets you set the title to whatever text you want. Unfortunately, it does not differentiate between "you" and "scripts that you run", and it doesn't (yet) have any extensibility you can configure. I agree 100% with the desire to have the tab number prefix on the (first 10) tabs, so it's easy to switch via hotkeys without counting -- and that's basically impossible for the shell/scripts to do. It might even be nice to be able to force a titlePrefix from the profile before whatever scripts try to set. That is, not just the tab number, but a word that represents the shell to me: "bash", "pwsh", "ubuntu", "wsl", "cmd", "PS7", etc. That way I could have tabs like:
I wouldn't fight the idea of providing a regex to let you configure that, like: We'll definitely need a few other features for those prone to lots of tabs like
|
### User Stories: 1. A user wants to be able to use the executable path as their starting title - Does anyone want this? 2. A user wants to be able to set a custom starting title, but have that title be overridable 3. A user wants to be able to set an overridable starting title, different from the profile name - Presumably someone will want this 4. A user totally wants to ignore the VT title and use something else - This will make more sense in the post [#1320] "Support runtime variables in the custom user title" settings ### Solutions: 1. `name`, `startingTitle`, `tabTitle` * a. `name` is only ever used as the profile name. * b. If `startingTitle` isn't set, then the executable path is used * c. If `startingTitle` is set, it's used as the initial title * d. If `tabTitle` is set, it overrides the title from the terminal * e. Current users of `tabTitle` need to manually update to the new behavior. 2. `name` as starting title, `tabTitle` as a different starting title * a. `name` is used as the starting title and the profile name in the dropdown * b. If `tabTitle` is set, we'll use that as the overridable starting title instead. * c. In the future, `dynamicTabTitle` or `tabTitleOverride` could be added to support [#1320] * d. Current users of `tabTitle` automatically get the new (different!) behavior. * e. User Story 1 is impossible - Does anyone want the behavior _ever_? Perhaps making that scenario impossible is good? 3. `name` unchanged, `tabTitle` as the starting title * a. `name` is only ever used as the profile name. * b. If `tabTitle` is set, we'll use that as the overridable starting title. * c. In the future, `dynamicTabTitle` or `tabTitleOverride` could be added to support [#1320] * d. Current users of `tabTitle` automatically get the new (different!) behavior. 4. `name` as starting title, `tabTitle` as different starting title, `suppressApplicationTitle` Boolean to force it to override * a. `name`, `tabTitle` work as in Solution 2. * b. When someone wants to be able to statically totally override that title (story 4), they can use `suppressApplicationTitle` * c. `suppressApplicationTitle` name is WIP * d. We'll add `suppressApplicationTitle` when someone complains * e. If you really want story 1, use `tabTitle: c:\path\to\foo.exe` and `suppressApplicationTitle`. [#1320]: #1320 We've decided to pursue path 4.
### User Stories: 1. A user wants to be able to use the executable path as their starting title - Does anyone want this? 2. A user wants to be able to set a custom starting title, but have that title be overridable 3. A user wants to be able to set an overridable starting title, different from the profile name - Presumably someone will want this 4. A user totally wants to ignore the VT title and use something else - This will make more sense in the post [#1320] "Support runtime variables in the custom user title" settings ### Solutions: 1. `name`, `startingTitle`, `tabTitle` * a. `name` is only ever used as the profile name. * b. If `startingTitle` isn't set, then the executable path is used * c. If `startingTitle` is set, it's used as the initial title * d. If `tabTitle` is set, it overrides the title from the terminal * e. Current users of `tabTitle` need to manually update to the new behavior. 2. `name` as starting title, `tabTitle` as a different starting title * a. `name` is used as the starting title and the profile name in the dropdown * b. If `tabTitle` is set, we'll use that as the overridable starting title instead. * c. In the future, `dynamicTabTitle` or `tabTitleOverride` could be added to support [#1320] * d. Current users of `tabTitle` automatically get the new (different!) behavior. * e. User Story 1 is impossible - Does anyone want the behavior _ever_? Perhaps making that scenario impossible is good? 3. `name` unchanged, `tabTitle` as the starting title * a. `name` is only ever used as the profile name. * b. If `tabTitle` is set, we'll use that as the overridable starting title. * c. In the future, `dynamicTabTitle` or `tabTitleOverride` could be added to support [#1320] * d. Current users of `tabTitle` automatically get the new (different!) behavior. 4. `name` as starting title, `tabTitle` as different starting title, `suppressApplicationTitle` Boolean to force it to override * a. `name`, `tabTitle` work as in Solution 2. * b. When someone wants to be able to statically totally override that title (story 4), they can use `suppressApplicationTitle` * c. `suppressApplicationTitle` name is WIP * d. We'll add `suppressApplicationTitle` when someone complains * e. If you really want story 1, use `tabTitle: c:\path\to\foo.exe` and `suppressApplicationTitle`. [#1320]: microsoft/terminal#1320 We've decided to pursue path 4.
VS Code's implementation, for reference: https://code.visualstudio.com/updates/v1_61#_custom-title-and-description |
The user should be able to embed certain terminal-specific variables in their custom title, that will be updated at runtime.
Something like:
Would then include the number of panes in the tab title text we display, like so:
"{isAdmin?\"Admin\":\"\"} - {title}"
to get "Admin - cmd.exe""{name} [{numberOfPanes<10?numberOfPanes : \"9+\"}]"
for "Powershell [2]" or "Powershell [9+]"[+{numberOfPanes}]
bit should be conditional on there being more than one pane? Could we combine this with the above case, and have nested conditionals?This is obviously related to #608, but this is certainly out of scope for v1.0. #608 is just setting a simple title string to override the terminal's, this is setting a dynamic title.
The text was updated successfully, but these errors were encountered: