Closed nphmuller closed 5 years ago
@kaaax0815 Yes this is for windows only
@manishprivet But bashrc would be wsl not native windows. Or where should I put it
@kaaax0815 Yes this is for windows only
@manishprivet But bashrc would be wsl not native windows. Or where should I put it
@kaaax0815 In the WSL's bashrc file actually
@manishprivet the matter has resolved itself. I changed the cmd search shortcut to wt and this fixed the path problem
You can now just go to settings -> profiles (Powershell / Command prompt)
.
And check the checkbox: 'Use parent process directory'
@KSneijders unfortunately we do not have that on wsl :(
actually we do, but it does not work
power shell also does not work
So, none of the above answers worked for my use case. What I'd like to do is open a new tab using
alt+shift+-
and keep the previous folder. I tried usingnull
,"."
and"%__CD__%"
as values for"startingDirectory"
in different places of the JSON. I'm using version1.4.2652.0
of Windows Terminal Preview.One nice solution would be to have a new option like
"keepCurrentDirectoryOnNewTab": true
or something like that. Other way (that Kitty uses) is having a special value calledcurrent
when specifying the directory.
I'm using Windows Terminal v1.11.2921.0 this worked for me:
If anyone is looking for a solution without changing startingDirectory
, I have placed such a file in %SystemRoot\System32
named wtx.cmd
:
@ECHO off
wt -d .
exit /B !ERRORLEVEL!
Remove
startingDirectory
from your profiles.json.
Thanks @DHowett-MSFT, I was making VSCode when pressing ctrl+ñ the external console wt.exe
appears, because the integrated one has problems with unicode in windows and, when I did it, it always started in my %USERPROFILE%, your solution worked, now runs in my project directory.
For those who are interested, I used wt --window 0 focus-tab
so that if I already have a WindowsTerminal window open, it will be raised instead of creating another instance.
You can now just go to
settings -> profiles (Powershell / Command prompt)
. And check the checkbox: 'Use parent process directory'
thank you! this solution is the best solution. and still working
You can open current directory in Windows terminal using explorer using
wt -d .
Please add wt -d
to wt -h
@jleaders the help text is understandably a little confusing in this particular case, because of the implicit new-tab
subcommand that's used when no subcommand is provided explicitly. You'll note, -d
is under wt new-tab --help
It's just that CLI11 doesn't know how to wire the args for new-tab
up to the help message for the root command's help text.
@nphmuller Referring to the first main discussion of thus topic, you can open a new terminal windows, placed in the current working folder, by typing "cmd" and press Enter in the url ##bar.
solution wt -d .
[ Settings : "Startup" → "standard terminal application" ] change this to windows terminal -> All Terminals open now in the Windows Terminal.
how to use %USERPROFILE%
in start menu if use Use parent process directory
for Open terminal in current folder via wt
Currently I can open cmd and powershell in the current folder via typing
cmd
orpowershell
in the address bar of explorer (which opens via CTRL+D, so it's really neat and quick).It would be great if this was also possible with the new Windows Terminal. But since it's a Windows Store app I can't find an easy way to add it to PATH. It also doesn't respect the current folder when opening. It always starts in the default folder (
C:\WINDOWS\system32
for cmd and~
for Ubuntu).It would be great if this was possible:
It would also be nice if it could be opened with a short command. The executable currently is called
WindowsTerminal
. Would be nice if we could simply type something liketerm
.