Skip to content

Windows/tabs created with "wt new-tab COMMAND" start with the title of the default Terminal profile, not the COMMAND name #6776

Closed

Description

Environment

Windows build number: Windows 10 ver. 2004 build 19041.329
Windows Terminal version (if applicable): 1.1.1812.0

Steps to reproduce

  1. 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.
  2. 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.)

Activity

  1. ghost added
    Needs-Triage
    on Jul 3, 2020
  2. ghost added
    Needs-Tag-Fix
    on Jul 3, 2020
  3. DHowett commented on Jul 10, 2020

    @DHowett
    Member

    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?

  4. added
    Needs-Author-Feedback
    on Jul 10, 2020
  5. metathinker commented on Jul 10, 2020

    @metathinker
    ContributorAuthor

    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.

  6. ghost added
    Needs-Attention
    on Jul 10, 2020
  7. ghost removed
    Needs-Author-Feedback
    on Jul 10, 2020
  8. added
    Area-Commandline
    Help Wanted
    Issue-Bug
    Product-Terminal
    and removed
    Needs-Attention
    Needs-Triage
    on Jul 15, 2020
  9. ghost removed
    Needs-Tag-Fix
    on Jul 15, 2020
  10. 12 remaining items

  11. removed
    Needs-Discussion
    Help Wanted
    on Jul 21, 2021
  12. DHowett commented on Aug 23, 2021

    @DHowett
    Member

    This was fixed in #10998. Thanks!

  13. ghost added
    Needs-Tag-Fix
    on Aug 23, 2021
  14. DHowett commented on Aug 23, 2021

    @DHowett
    Member

    (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.)

  15. added a commit that references this issue on Aug 24, 2021
    7cdbf9c
  16. ghost added
    In-PR
    on Aug 24, 2021
  17. ghost removed
    In-PR
    on Aug 24, 2021
  18. ghost added a commit that references this issue on Aug 24, 2021
    7b6df26
  19. ghost added
    Resolution-Fix-Committed
    on Aug 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Area-CommandlineIssue-BugNeeds-Tag-FixPriority-2Product-TerminalResolution-Fix-Committedthis-will-be-a-breaking-change

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions