Open WT in selected directory by default (e.g. User Homd directory) #15985

Closed
opened 2026-01-31 04:54:03 +00:00 by claunia · 3 comments
Owner

Originally created by @Zingam on GitHub (Nov 27, 2021).

If WT is opened from a shortcut I would prefer if the default directory is set to user's desktop directory or user's home directory and in any other case to the process directory, like when opening it via right click on a folder or by typing WT in Explorer.
Currently with this setting (Use process directory) WT opens by default: C:/Windows/System32 which is probably the last place I need it to open. So I think in this case it would be much more useful if by default WT opens C:/Users/<User's home> or some other preset location.

Currently I don't see how I can achieve that. If I set %USERPROFILE% then I loose the ability to open WT directly in any other location.

Originally created by @Zingam on GitHub (Nov 27, 2021). If WT is opened from a shortcut I would prefer if the default directory is set to user's desktop directory or user's home directory and in any other case to the process directory, like when opening it via right click on a folder or by typing WT in Explorer. Currently with this setting (Use process directory) WT opens by default: C:/Windows/System32 which is probably the last place I need it to open. So I think in this case it would be much more useful if by default WT opens C:/Users/<User's home> or some other preset location. Currently I don't see how I can achieve that. If I set %USERPROFILE% then I loose the ability to open WT directly in any other location.
Author
Owner

@zadjii-msft commented on GitHub (Nov 29, 2021):

This is an unfortunately complicated problem, with a lot more details in

So, I'd recommend leaving startingDirectory set to %USERPROFILE%, and manually adding -d . to the commandline for your shortcuts. That'll get you the behavior you want:

  • shortcuts will open up in the surrent directory
  • right-click in explorer will open up in explorer's CWD
  • launching from the Start Menu, Taskbar, etc, will launch in %USERPROFILE%
@zadjii-msft commented on GitHub (Nov 29, 2021): This is an unfortunately complicated problem, with a lot more details in * https://github.com/microsoft/terminal/issues/878#issuecomment-538511693 * https://github.com/microsoft/terminal/pull/3547 * https://github.com/microsoft/terminal/issues/878#issuecomment-579508860 So, I'd recommend leaving `startingDirectory` set to `%USERPROFILE%`, and manually adding `-d .` to the commandline for your shortcuts. That'll get you the behavior you want: * shortcuts will open up in the surrent directory * right-click in explorer will open up in explorer's CWD * launching from the Start Menu, Taskbar, etc, will launch in `%USERPROFILE%`
Author
Owner

@Zingam commented on GitHub (Nov 29, 2021):

This doesn't solve the issue to open a terminal via File Explorer's (address bar??) that I learned to use instead of adding Command Prompt to the right click menu via the registry a long time ago. Yet the proposed solutions sound like a good start. Why don't you create this configuration and short cuts by default during installation? At least this wasn't the case when I installed WT.

@Zingam commented on GitHub (Nov 29, 2021): This doesn't solve the issue to open a terminal via File Explorer's (address bar??) that I learned to use instead of adding Command Prompt to the right click menu via the registry a long time ago. Yet the proposed solutions sound like a good start. Why don't you create this configuration and short cuts by default during installation? At least this wasn't the case when I installed WT.
Author
Owner

@Zingam commented on GitHub (Nov 29, 2021):

So, I'd recommend leaving startingDirectory set to %USERPROFILE%, and manually adding -d . to the commandline for

OK. I guess -d . is meand for File Explorer bar. What about introducing an alternative alias for that like 'wtd', which will do what wt -d . It may not look that much shorter but in the long term it save the planet from overheating.

Thank you for taking the time to answer my issue!

@Zingam commented on GitHub (Nov 29, 2021): > So, I'd recommend leaving `startingDirectory` set to `%USERPROFILE%`, and manually adding `-d .` to the commandline for OK. I guess -d . is meand for File Explorer bar. What about introducing an alternative alias for that like 'wtd', which will do what wt -d . It may not look that much shorter but in the long term it save the planet from overheating. Thank you for taking the time to answer my issue!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#15985