-
Notifications
You must be signed in to change notification settings - Fork 28.2k
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
Integrated Terminal : Allow Renaming sessions #10023
Comments
@stevencl @bgashler1 thoughts on this from UX side? I was thinking something like this would be quite cumbersome as you would have to do it whenever you launch a new terminal instance. |
I would expect it would be optional. Just a quick thought but could you right click on the dropdown and choose a rename command? |
If the goal is to distinguish between different terminals, how about just automatically showing the last command run in each terminal? That way the user wouldn't even have to bother renaming if they just want to be bale to distinguish between multiple terminals (assuming that they aren't running the same command in every terminal). If we have to expose an action, right click probably isn't the best approach as it is a little unusual to right click on a drop down. Thinking of this like a regular combobox though, perhaps just single clicking inside the drop down could highlight the text which the user could then replace. I'm reluctant to add more buttons as that just adds weight and takes up space. I'd definitely expect that we should have some keyboard bindings for it. |
For me it is mainly to distinguish the different terminals. So for me personally showing the last ran command is also fine. |
Right clicking the terminal could also be an option, there's already a context menu there. Also another piece of information I feel is missing is the current number of terminals, integrating everything into the dropdown could get messy, eg. "2/3: /bin/bash (gulp watch)" |
For UX I would like:
It would also be nice if it was possible to launch terminals with a specific name to leave room for extensions which could allow you to organize and launch standard sessions. I'm not sure if this is already possible. |
With the "last run command" option would you display the full command line or just the command? Particularly when using Go, there are good reasons to have multiple terminals using the same "command" since many Go tools start with "go" ("go build", "go test", "go tool pprof", etc...). I'll often have an active profiling session open in one terminal while running builds / tests in another session. Unfortunately they're both the same "command" ("go"). I would say displaying the last run command is useful, but doesn't satisfy the same requirements as explicitly allowing renaming sessions. I would treat it as separate feature request to this one. |
Going by the suggestions made, I believe there are two points this RFE should consider.
Much needed! |
In addition to the context menu (which I still think is a bit unusual) I was thinking of a design similar to this experience With the addition that I wouldn't make the text area editable by default. Perhaps guard against undesired edits by making the user click inside the area once to position a cursor at the end. Another alternative design is that there is an <Rename...> entry at the bottom of the dropdown. If the user chooses this, they see a dialog box that displays the list of terminals. The user can select one, press a rename button, then type in the new name. It's quite cumbersome compared to the others but it puts the functionality out of the way meaning that people will be much less likely to rename a terminal. |
@stevencl I was speaking with @bgashler1 the other day about custom dropdowns for the panel This also may not work if we want to put buttons inside the dropdown? Something to consider. |
OK, how about we just start by automatically showing the last command run in each terminal? That seems to be the least we can do to help distinguish between the different terminals without requiring us to create custom controls to rename terminals. |
Not sure if it's clear, but right now on platforms other than Windows it will show the currently running program, not just the shell name, So originally it's There are some issues with trying to amend this string with the "last command run" as I don't think it's even possible to extract that information in a reasonable way given the array of shells that could be getting used and their syntax. Also commands are not composed and then sent to the shell, each keystroke is converted into an ANSI key sequence and sent to the terminal at that time, depending on the key stroke the output on the actual terminal could be the key, it could be ignored, it could output garbage. There isn't a reliable way as far as I'm aware to get the command that is run from the terminal, only the last program run. The last program to be run could also be a shell which would be super weird, consider Due to technical constraints on Windows it is always |
@stevencl @Tyriar I still think it's worth splitting "last run command" and "renaming the window" into two separate requests, even if the latter gets shelved due to the UX complexity. I think there is value in both, but I don't believe last run command would meet requirements set out by the OP (@geevi correct me if I'm wrong!). It definitely wouldn't meet the requirements of the feature request that I was going to fill out before my duplicate search lead me to this one. |
OK, in that case lets go with the other suggestion I made: Another alternative design is that there is an entry at the bottom of the dropdown. If the user chooses this, they see a dialog box that displays the list of terminals. The user can select one, press a rename button, then type in the new name. It's quite cumbersome compared to the others but it puts the functionality out of the way meaning that people will be much less likely to rename a terminal |
Another option could be to have a button and key binding that brings up a dialog similar to the find/replace dialog (and hopefully reuse the code) in the top right with the current window name, allowing you to rename. |
Adding my support for this feature. Googled to see if there was an option after I opened five terminal sessions (Windows 10) and couldn't remember what was running in each session. They all say "cmd.exe" which doesn't help at all. |
+1 for this feature request. Also, if we are working over SSH, just showing the last command run is not helpful. Hence it would be good to have a custom renaming. |
+1 custom renaming |
+1 |
Update on this:
|
Opening this up to PRs, here's what we need:
|
Hey @Tyriar, I'm taking a look at this one. I've modified the Thanks much! |
@jammerware the command |
Modified terminalInstance to expose setTitle and fire the onTitleChanged event when it's called. Added workbench.action.terminal.rename contribution from the workbench and the action that fires when it's run.
Should land in Insiders tomorrow thanks to @jammerware 👍 #28464 |
waiting for this feature in the stable version |
Can it use the console caption as the default session name? |
@zephrxx what's the console caption? |
zephrxx ah, well I don't think we have access to that and also it would be too long for the dropdown. In #30152 we're looking into getting Windows closer to the Linux/macOS experience which shows the active program/shell:
|
Just press CTRL+SHIFT+P, then type TERMINAL RENAME, enter a name and press ENTER. :-D |
Please add a feature to rename sessions in the integrated terminal.
Usually one opens multiple terminal sessions using the same command like ssh. Then all these sessions are called ssh in the dropdown. Please allow to rename the session, so that its easy to choose.
The text was updated successfully, but these errors were encountered: