You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows/tabs created with "wt new-tab COMMAND" start with the title of the default Terminal profile, not the COMMAND name #6776
Windows build number: Windows 10 ver. 2004 build 19041.329 Windows Terminal version (if applicable): 1.1.1812.0
Steps to reproduce
While Terminal is closed, delete or rename your settings.json file, causing Terminal to revert to the default settings under which the built-in Windows PowerShell profile for Terminal {61c54bbd-c2c6-5271-96e7-009a87ff44bf} is the default one.
Run this command: wt.exe C:\Windows\System32\robocopy.exe
Expected behavior
The title of the Terminal tab created is "C:\Windows\System32\robocopy.exe" or similar.
Actual behavior
The title of the Terminal tab created is "Windows PowerShell".
(If you watch Task Manager or another process listing, you can see that no PowerShell process was ever started.)
So, this one is weird... I'm not sure how we should handle it. I'm not certain setting the commandline to be the title is the right thing to do.
A profile is closer to a shell link than an unjacketed command. A traditional console host started from a LNK inherits the stem name of the LNK file, not the commandline string stored inside it. However, there's no true provision for taking a LNK and "running a different command" with it. . . except STARTF_TITLEISLINKNAME. Spawning a console process with one commandline but another [profile equivalent] specified in its startup info results in the same behavior as reported here.
I'm inclined to call it by design. What do you think?
Those are all good points you've made. My point of view, though, is that I'm not specifying a profile name on the wt command line, I'm specifying a command to run. So the analogy between a Terminal profile and a console app shortcut/.lnk file is not something I think of at all. And if I look for the window I just created, I don't expect it to have the title of a shell or app I never actually launched, which is the case now since the profile name is being picked up.
This could be even more of a problem if and when wt from within Terminal is changed to create a new tab instead of a new window, since now you have a new tab in Windows Terminal that is misleadingly named and you won't necessarily be able to see the difference at a glance.
Hence, I would not be happy with a design of Terminal that incorporates the current behavior. We can certainly try to come up with something that we're both happy with, though.
ghost added
Needs-AttentionThe core contributors need to come back around and look at this ASAP.
(We took the path of making the title match the first segment of the command, and are decoupling profile choice at the same time. We'll work on pulling icons and stuff out if necessary later. Changing the profile is a breaking change, the rest are new fun features.)
Activity
DHowett commentedon Jul 10, 2020
So, this one is weird... I'm not sure how we should handle it. I'm not certain setting the commandline to be the title is the right thing to do.
A profile is closer to a shell link than an unjacketed command. A traditional console host started from a LNK inherits the stem name of the LNK file, not the commandline string stored inside it. However, there's no true provision for taking a LNK and "running a different command" with it. . . except
STARTF_TITLEISLINKNAME. Spawning a console process with one commandline but another [profile equivalent] specified in its startup info results in the same behavior as reported here.I'm inclined to call it by design. What do you think?
metathinker commentedon Jul 10, 2020
Those are all good points you've made. My point of view, though, is that I'm not specifying a profile name on the
wtcommand line, I'm specifying a command to run. So the analogy between a Terminal profile and a console app shortcut/.lnk file is not something I think of at all. And if I look for the window I just created, I don't expect it to have the title of a shell or app I never actually launched, which is the case now since the profile name is being picked up.This could be even more of a problem if and when
wtfrom within Terminal is changed to create a new tab instead of a new window, since now you have a new tab in Windows Terminal that is misleadingly named and you won't necessarily be able to see the difference at a glance.Hence, I would not be happy with a design of Terminal that incorporates the current behavior. We can certainly try to come up with something that we're both happy with, though.
12 remaining items
Rely more on profile objects and less on GUIDs (#10982)
DHowett commentedon Aug 23, 2021
This was fixed in #10998. Thanks!
DHowett commentedon Aug 23, 2021
(We took the path of making the title match the first segment of the command, and are decoupling profile choice at the same time. We'll work on pulling icons and stuff out if necessary later. Changing the profile is a breaking change, the rest are new fun features.)
Move commandline->title promotion into TerminalSettings
Move commandline->title promotion into TerminalSettings (#11029)
Use the "base" profile for incoming handoff and new commands (#11022)