I'm using WSL2 with ComEmu.
When I just setup a task only by wsl.exe
it open the bash with /mnt/c/Users/username
directory. So I set up the command like this.
wsl.exe -cur_console:pm:/mnt ~
With this config I can open a bash terminal with home directory in Ubuntu.
After that I created a my_project
directory and change current to it.
mkdir my_project
cd my_project
Now I open a new tab, then I go back to my Ubuntu home directory. How can I open a new bash tab while keeping current directory?
Reply to the comments
I open a new tab by a keyboard shortcut that triggers Create new {Ubuntu} console
command or just click the +
icon. I configured Ubuntu
task as default.
~
, but then subsequent tabs/sessions to use the current directory of the current tab? I looked at the ConEmu docs for a bit, and I didn't see any obvious way to do this. The docs even say that it is challenging to get the current directory from a WSL session. You have to hook your PS1 (prompt) to send a message back up to ConEmu. Then you are still left with the "conditional" of determining if you are opening the first tab or a subsequent one, and I didn't see a way to do that.cd
command after I open a new session. Thanks.