0

now I'm currently using Visual Studio Code and I wanted to make the terminal use babun instead of the default cmd.exe
In fact, I have already managed to do that in theory - the problem is that, unlike with cmd.exe, the directory that I'm in upon starting the terminal is no longer the currently open project, it's just simply /home/myusername (i.e. a path in babun's directory tree).
This kinda sucks, since I don't really want to navigate to my directory every time.
Next, I also found out how to tell babun (in my case, zsh.exe) to use a default directory such as C:/ by adding cd /cygdrive/c to the end of .zshrc - Unfortunately, that's not what I want either, since I don't want babun to always use the same directory.

Now I figured that, seeing as this would be the most comfortable option with VSC*, there might be some console argument that tells zsh.exe to use a specific directory. Sadly, I couldn't find anything, hence this question. Weirdly enough

Anyone know how to help me out? Appreciate the help :)

*VSC allows you to specify the path to your shell, as well as an array of arguments that will be passed.

PixelMaster
  • 895
  • 10
  • 28
  • If I wanted to do the same thing with cmd.exe, I'd do `cmd.exe /k "cd C:\desired\path"` Unfortunately, that doesn't work with babun :( – PixelMaster Aug 18 '17 at 12:33
  • Is it possible to add a check to your .zshrc whether the caller was vscode? Another idea could be to write a cmd file that changes to the right dir then invokes zsh.exe. I have neither of these tools installed except cygwin, just guessing. – yacc Aug 18 '17 at 16:44

3 Answers3

0

You could place your directory into a cmd file and run it as a shell:

d:
@rem note that's important to change the drive 'permanently'
cd d:\home
zsh.exe

And then specify this cmd file as shell to invoke.

yacc
  • 2,915
  • 4
  • 19
  • 33
  • I'll give it a shot, but seeing as I'd like the terminal to run inside of VSC, I'm not sure it'll work – PixelMaster Aug 21 '17 at 09:12
  • @PixelMaster Did you have a look into this: https://github.com/Microsoft/vscode/issues/15531 ? `terminalHere.create` – yacc Aug 21 '17 at 09:42
  • Haven't had a look so far, but I don't think it'd help - seeing as I don't want the regular windows shell, but a babun shell. The normal cmd.exe-shell works fine & launches in the correct directory. Anyways, I opened an issue on babun's github repository. Hopefully someone there will know an answer (and also make the effort of sharing it ^^) – PixelMaster Aug 21 '17 at 10:12
0

Open the desired directory in a file explorer, right click, then select Open Babun here.

narancs
  • 15
  • 5
  • I know that this works, I even reference this possibility in the question. The goal here is to open babun via the command line, not manually with a mouse. – PixelMaster Jan 16 '19 at 09:51
0

Babun currently does not natively support a command line parameter specifying the directory to launch in.

However, there is a pull request in the Babun GitHub which solves the issue. Unfortunately, it doesn't seem to be likely to be accepted anytime soon, though.

To gain access to the feature manually, check out the pull request.

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
PixelMaster
  • 895
  • 10
  • 28