Skip to content

Include directory flag -d in Help dialog #20024

Description

Description of the new feature

  1. Include "-d PATH Specify directory to start in" in the Help dialog
  2. (optional) If [SUBCOMMAND] is a path, treat that as a directory argument to start the terminal in

Backstory:
I wanted to create a terminal window from a different cli window (VSCode in this case) starting in the same path. The help dialog did not list anything close to what I wanted, so I had to ask Google (the shame). I often launch gui tools from cli with parameters relative to my present working directory.

Proposed technical implementation details

At minimum, add the text "-d PATH Specify directory to start in" in the Help dialog somewhere in the Options section.

For the optional part:
Currently returns "[error 2147942405 (0x80070005) when launching `.']" and an otherwise stuck window.
Instead: perform a type check on the object at the path. If it's a directory, treat like a parameter to "-d" and open a window at that path. Otherwise, maintain existing behavior.
Not sure the difficulty of adding an object type check when a Subcommand is passed as a parameter. In the short term, I'm writing a PowerShell shim wt.ps1 that I'll place higher in my PATH.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-Commandlinewt.exe's commandline argumentsIssue-TaskIt's a feature request, but it doesn't really need a major design.Product-TerminalThe new Windows Terminal.

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions