-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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 rename Tab title at runtime #1079
Comments
Couldn't the Profile name be used for the tab title by default, but maybe an option to display a path instead? The path is usually there in the pompt, so not sure its needed in both. |
The path is there because it is what the shell has put there. For discussions about that and the merits of titles, #608. This is a slightly different ask. |
Profile just shows the CMD or PowerShell.. but what I am proposing is to be able to rename Tab with a friendly name. |
I'm pretty sure this is a subset of one of the solutions I proposed in that thread:
|
Renaming the tab would imply the name is there until that tab is closed. My suggestion would be to allow a profile to have a name chosen by the user |
Though, I guess I leave this open to track specifically adding a button to the tab right click menu to set the profile's TitleText. er, now that I've typed this up, maybe we should have a runtime text we modify. I'm thinking in the case where a user has multiple tabs with the same profile open. If the user want to rename one of the tabs, they probably don't want that name applied globally to each of the tabs with that profile. They probably just want to rename that _one_ tab. So this should involve setting a flag on the Tab that it's using a runtime title as opposed to the title from the control, and we should just ignore all title changes from the control. If the profile's title setting is changed, then we'll ignore that also. Though a question here would be should that custom string apply to the Tab or the focused Pane? I'd probably presume it'd apply to the Tab, not the Pane. |
@zadjii-msft it should apply to tab. Also if it clear text, it should set runtime flag to false. This will also enable tab to start using profile name. |
@carlos-zamora wanted to work on tab actions, and I think this is a pretty good fit. He even suggested it! So here’s the deal: there’s clearly three different schools of thought here regarding title, so this is now |
YES! I really want this feature. Definitely a question of how this interacts with the shell/distro sending a title up to the tab (#608). I also noticed that the hovering action should be included in this (i.e.: hovering over tab displays the full path beneath the mouse [try on Edge]). @cinnamon-msft and I will draft up a spec soon. We're super excited! |
Suepr. Let me know how I can as a developer contribute. |
Note that you can also set the title from command line with |
We should use #608 to track tab titling issues. Thanks! |
Very helpful! I added a function to my Powershell Profile to let me set it more easily:
|
This is perfect idea for my productivity tracker wich use tab names. It would be awesome to automate it in the runtime. My work around:
|
Hi. Please, which tracker do you use? |
ManicTime |
The powershell only helps if that's what your running. When running ssh terminals with openssh, it would be nice to rename tabs to knew which host I'm on. It pickups up the first host you goto then after that that's what it display's, but if you change servers it doesn't update. I would love a r-click to rename option, or even some environment variable I could set it would pick up. |
I mean, that’s just something you could configure on those servers. :) |
You say that when we are talking over 1000 servers. I'm trying this out over xshell, and I have a bastion host that i jump from, and looking for an easy way to keep track of the server name. With xshell this done with scripting I use to set it internally. Al tho I am playing with |
## Summary of the Pull Request Adds support for setting, from the UI, a runtime override for the tab title text. The user can use this to effectively "rename" a tab. If set, the tab will _always_ use the runtime override string. If the user has multiple panes with different titles in a pane, then the tab's override text will be used _regardless_ of which pane was focused when the tab was renamed. The override text can be removed by just deleting the entire contents of the box. Then, the tab will revert to using the terminal's usual title. ## References * Wouldn't be possible without the context menu from #3789 * Focus doesn't return to the active terminal after hitting <kbd>enter</kbd>/<kbd>esc</kbd>, but that's tracked by #5750 ## PR Checklist * [x] Closes #1079 * [x] I work here * [ ] Tests added/passed * [ ] Requires documentation to be updated ## TODO * [x] `Tab::SetTabText` might be able to be greatly simplified/removed? * [x] I'm _pretty sure_ if they set an override title, we won't bubble that up to set the window title. * [x] I'm unsure how this behaves when the terminal's title changes _while_ the TextBox is visible. I don't think it should change the current contents of the box, but it might currently. * [ ] **for discussion**: If the user doesn't actually change the text of the tab, then we probably shouldn't set the override text, right? - EX: if they open the box and the text is "cmd", and immediately hit <kbd>enter</kbd>, then run `title foo`, should the text change to "foo" or stay "cmd"? ## Detailed Description of the Pull Request / Additional comments ![image](https://user-images.githubusercontent.com/18356694/81230615-713f9180-8fb7-11ea-8945-6681eec02a4f.png) ![image](https://user-images.githubusercontent.com/18356694/81230640-7ac8f980-8fb7-11ea-9e6b-22f0e0ed128a.png) ![image](https://user-images.githubusercontent.com/18356694/81230665-86b4bb80-8fb7-11ea-90f0-16d4ffb60d89.png) ![image](https://user-images.githubusercontent.com/18356694/81230686-9207e700-8fb7-11ea-94a9-f3f5a59be139.png) ![image](https://user-images.githubusercontent.com/18356694/81230732-a350f380-8fb7-11ea-9901-6dd4f36154f1.png) ![image](https://user-images.githubusercontent.com/18356694/81230746-a8ae3e00-8fb7-11ea-94fa-d2578f9241a7.png) ![image](https://user-images.githubusercontent.com/18356694/81230787-bc59a480-8fb7-11ea-8edf-2bd7fad343fc.png) ![image](https://user-images.githubusercontent.com/18356694/81230851-dc896380-8fb7-11ea-98c1-918b943543e4.png)
🎉This issue was addressed in #5775, which has now been successfully released as Handy links: |
Wow.. Congratulations team :D Apologies, I did not participate in thread much.. but I was following it closely. It gave me a great insights into how Microsoft plans features.. I have always trusted Microsoft.. but this process has given me kind of assurance that features are thought in details.. and with a quality in mind.. feature small as this one how it can be turned into a great feature is what this thread really teaches. |
Yes, congratulations to the team. I miss one thing yet, being able to double click in tab to rename it, is that feature planned? |
Need to be able to set a key binding for tab rename (F2 by default would make sense?) |
@Inrego You can just right click on the tab to rename it. KB shortcuts strike me as something needed for actions you perform often, so you don't want to use the mouse. But how often do you really rename a tab while working? I think the right-click menu is sufficient. Just my 2 cents. |
@mfeemster a console application strikes me as something that shouldn't require a mouse to operate. Besides that, I would like to automate naming tabs in my password manager when logging in to a server. |
There's KB shortcut to open a new tab. I'd argue that renaming a tab could be an action that is performed more often than opening a tab. Or there's also a KB shortcut to close all tabs. Also an action that is more rarely performed. Just because you rarely rename a tab, doesn't mean that you can assume that it's a rare action for everyone. What I'm trying to say, it shouldn't really be the reason to implement it or not, as it's very subjective and varies from person to person. |
You can do this with a key binding for |
That's exactly what I need, thanks. I'll follow that PR |
I'm seeing a few hacks for bash like |
@lukaseder in 1.1 we added the ability to just rename the title from the UI - IIRC |
@zadjii-msft I know, I'm using that all the time, but since the tabs can't be reopened from a previous session (see #961), I was going to work around this by scripting my usual 10 tabs into
That did the trick, thank you! PS1 was set to:
setting it to this in
|
Good tip! If you use powershell and want your title to reflect the current directory context, you can set it in your global:prompt function. For example, I always want it to reflect the current repo's root dir (if I'm in a repo):
|
Tabs are very useful feature, but as you open more and more tabs, it becomes difficult and confusing to keep track of which tab is for which purpose unless you the tab. It will be better if we can rename the Tab and give it a friendly name.
The way we can implement the tab renaming from functional point of view is:
1 - Right click -> Rename
Right click on a tab which user wants to rename, this will open up context menu and from context Menu, user will select Rename.
Title of the tab will change into a TextBox, and user will be able to write Tab name, and on hitting enter key on the keyboard or clicking anywhere outside the textbox will apply the tab title. If user presses ESC key, we will discard the changes.
2 - Double click - tab title
Title of the tab will change into a TextBox, and user will be able to write Tab name, and on hitting enter key on the keyboard or clicking anywhere outside the textbox will apply the tab title. If user presses ESC key, we will discard the changes.
Final result will look like:
The text was updated successfully, but these errors were encountered: