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

Integrated Terminal : Allow Renaming sessions #10023

Closed
geevi opened this issue Aug 1, 2016 · 31 comments · Fixed by #28464
Closed

Integrated Terminal : Allow Renaming sessions #10023

geevi opened this issue Aug 1, 2016 · 31 comments · Fixed by #28464
Assignees
Labels
feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities on-testplan terminal Integrated terminal issues
Milestone

Comments

@geevi
Copy link

geevi commented Aug 1, 2016

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.

@Tyriar Tyriar added feature-request Request for new features or functionality terminal Integrated terminal issues labels Aug 1, 2016
@Tyriar Tyriar self-assigned this Aug 1, 2016
@Tyriar Tyriar added this to the Backlog milestone Aug 1, 2016
@Tyriar
Copy link
Member

Tyriar commented Aug 2, 2016

@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.

@stevencl
Copy link
Member

stevencl commented Aug 2, 2016

I would expect it would be optional. Just a quick thought but could you right click on the dropdown and choose a rename command?

@JostCrow
Copy link

JostCrow commented Aug 4, 2016

I would like to see a new button near the dropdown. Something like my screenshot. Also a command when you are in the terminal like ctrl+shift+r or f2 would be nice.

button example:
screenshot from 2016-08-04 10 22 23

@stevencl
Copy link
Member

stevencl commented Aug 4, 2016

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.

@JostCrow
Copy link

JostCrow commented Aug 4, 2016

For me it is mainly to distinguish the different terminals. So for me personally showing the last ran command is also fine.

@Tyriar
Copy link
Member

Tyriar commented Aug 4, 2016

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)"

@evandigby
Copy link

evandigby commented Aug 5, 2016

For UX I would like:

  • If you hover over session name in dropdown (or new edit box beside the dropdown or beside "TERMINAL") the mouse pointer turns to text cursor. You can select and rename the session easily
  • Key binding for a command to rename which automatically moves focus / cursor to a fully selected name so you can immediately type a new one (or modify the selection to augment the existing name).
  • In either case enter or some other key binding "saves" and returns focus and cursor to the terminal prompt

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.

@evandigby
Copy link

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.

@rjoshi31
Copy link

rjoshi31 commented Aug 8, 2016

Going by the suggestions made, I believe there are two points this RFE should consider.

  1. [Default Mode] The dropdown should always display last command run (truncated). Hovering over the dropdown can display the full text.
  2. [Custom Mode] In case the user wants a custom name, they can right click the dropdown to make inline edits. Thereafter, the new input will be set as the default for that terminal.

Much needed!

@stevencl
Copy link
Member

stevencl commented Aug 8, 2016

In addition to the context menu (which I still think is a bit unusual) I was thinking of a design similar to this experience

dropdown

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.

@Tyriar
Copy link
Member

Tyriar commented Aug 8, 2016

@stevencl I was speaking with @bgashler1 the other day about custom dropdowns for the panel x icon discussion. I don't think we do custom dropdowns currently which would be necessary for something like this, custom dropdowns are a decent chunk of effort to get right (fitting in with each OS, ensuring accessibility, etc.).

This also may not work if we want to put buttons inside the dropdown? Something to consider.

@stevencl
Copy link
Member

stevencl commented Aug 9, 2016

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.

@Tyriar
Copy link
Member

Tyriar commented Aug 9, 2016

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 /bin/bash, but when I run gulp watch the label is changed to gulp as that's the active program. Once gulp watch exits it will go back to /bin/bash since that is now the active program.

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 zsh (/bin/bash) for example, launching zsh from bash.

Due to technical constraints on Windows it is always cmd.exe or whatever the shell name is, this discussion likely wouldn't be able to affect the Windows situation.

@evandigby
Copy link

@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.

@stevencl
Copy link
Member

stevencl commented Aug 9, 2016

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

@evandigby
Copy link

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.

@catdadcode
Copy link

catdadcode commented Oct 5, 2016

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.

@vivekvenkatesh
Copy link

+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.

@tianjianchn
Copy link

+1 custom renaming
and custom order

@zephrxx
Copy link

zephrxx commented Mar 6, 2017

+1

@Tyriar
Copy link
Member

Tyriar commented Mar 7, 2017

Update on this:

@Tyriar
Copy link
Member

Tyriar commented Apr 20, 2017

Opening this up to PRs, here's what we need:

@jammerware
Copy link
Contributor

Hey @Tyriar, I'm taking a look at this one. I've modified the TerminalInstance to support renaming, defined a new Action in terminalActions to expose it, and (I think) done the de-registration of the terminal process message handler for title changes. Do I also need to figure out how to present the UI for the user to enter the name of the terminal, or is the intent that I just PR this stuff and you guys work that out?

Thanks much!

@Tyriar
Copy link
Member

Tyriar commented May 31, 2017

@jammerware the command workbench.action.terminal.rename should present a quick open that lets the user enter the new name. To do that I think you want to use this https://github.com/Microsoft/vscode/blob/f1a8632778e4574cf07b3cb162aa998e4a51aebc/src/vs/platform/quickOpen/common/quickOpen.ts#L136

jammerware added a commit to jammerware/vscode that referenced this issue May 31, 2017
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.
@Tyriar Tyriar modified the milestones: June 2017, Backlog Jun 12, 2017
@Tyriar
Copy link
Member

Tyriar commented Jun 12, 2017

Should land in Insiders tomorrow thanks to @jammerware 👍 #28464

@winuxue
Copy link

winuxue commented Jul 4, 2017

waiting for this feature in the stable version

@zephrxx
Copy link

zephrxx commented Jul 12, 2017

Can it use the console caption as the default session name?

@Tyriar
Copy link
Member

Tyriar commented Jul 12, 2017

@zephrxx what's the console caption?

@zephrxx
Copy link

zephrxx commented Jul 12, 2017

By caption I mean the highlighted part in the screen shot below.
capture

@Tyriar
Copy link
Member

Tyriar commented Jul 12, 2017

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:

  • If you launch powershell it will say "powershell"
  • If you launch cmd inside powershell, it will say "cmd"
  • If you launch npm install inside powershell, it will say "node"

@thiagoufg
Copy link

Just press CTRL+SHIFT+P, then type TERMINAL RENAME, enter a name and press ENTER. :-D

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
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 on-testplan terminal Integrated terminal issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.