
I was able to reproduce this problem by manually putting a space into my local PROMPT var, so it's not a clink problem per-se, but I guess in your case, clink is why the space is there, even though it's not visible in the displayed prompt.Īh, someone did get it working with clink in the end: #3158 (comment). So the instructions should be updated to quote the %PROMPT% as you have done.
#ITERM2 OPEN NEW TAB IN SAME DIRECTORY WINDOWS#
My guess would be that it's eating the ANSI codes, so the OSC command is never seen by Windows Terminal.įor the setx issue, it's probably because a " " has ended up in your prompt env-var (I would guess that clink lives in your prompt already). Somewhere in the hidden comments of this ticket, there was a note that clink was interfering with the relevant ANSI codes, and I don't believe it was ever resolved. I'm pretty sure clink is your problem here, as without it, both commands worked for me as per the instructions. Maybe this does need more specification 😨 What happens when this command is output over SSH? The terminal can't know that the path isn't on this machine anymore, right? How does Terminal.app handle this? tell that this is a WSL path, not a Windows pathĭo we need to add some property on our side that indicates "this is a WSL distro, not a Windows exe"? What happens to users who don't set that, does the duplicate tab functionality just not work (effectively silently)?.What are we supposed to do when someone tries to set the working directory to /home/zadjii? How we: Say bash is configured to emit that, and someone runs bash in WSL. I'm not really sure there needs to be anything more formal than that. Honestly, I'm pretty okay using the de-facto standard that's already in place, the OSC 7 ST mechanism. So for the record, the thread at alacritty/alacritty#2937 has a pretty great discussion. The disadvantage of OSC 7 is that it requires cooperation from the shell, or other apps that matter. make) and it – luckily – won't be make's internal subdir that's used. However, launch an app that internally changes directory (e.g. you start another nested subshell, it'll be the subdirectory of that subshell that's taken into account because that one also emits this sequence. The advantage of the OSC 7 approach is that it's clever regarding when to and when not to follow a child process.

go to the directory set via OSC 7 if it was ever emitted, otherwise dig into the process. Yet another possibility is to mix the two, e.g. It originates from macOS Terminal.app, and was later adopted by some other ones, including GNOME Terminal and as far as I know Konsole too.Īnother possible approach is to do some OS-specific hacks to examine the inner state of the child process (or even further down to descendents).


There's a "standard" escape sequence (OSC 7 URI ST) to set the terminal emulator's belief about the current directory.
