wbond / sublime_terminal

Launch terminals from the current file or the root project folder
https://packagecontrol.io/packages/Terminal
MIT License
600 stars 117 forks source link

terminal not opening in correct location #201

Closed Tim-at-AST closed 5 years ago

Tim-at-AST commented 5 years ago

When I press the hotkey, the terminal opens at a specific directory but not the directory of the folder or of the project. I am using Mac OS Mojave 10.14.3, Sublime text 3.1.1.

Any setting I might need to change?

twolfson commented 5 years ago

We have 2 hotkeys, 1 for directory of the current file and 1 for directory of the project folder. Here are the various platforms/hotkeys:

Tim-at-AST commented 5 years ago

The problem is that both hotkeys go to the same folder, and the folder is NOT the current folder OR the project folder.

twolfson commented 5 years ago

Can you provide us the following information?

twolfson commented 5 years ago

Could you scroll up to the very top of the sidebar? And are there multiple folders open in this project?

twolfson commented 5 years ago

Hmmm, okay. Is there any error message appearing in the console in Sublime Text? (command+`)

Tim-at-AST commented 5 years ago

This may be relevant: when I open Terminal.app preferences (under General), there is this message when I click on "Escape Sequence ...":

screen shot 2019-01-29 at 9 03 09 pm

The BASH i am using is from MacPorts. GNU bash, version 5.0.2(1)-release (x86_64-apple-darwin18.2.0)

Tim-at-AST commented 5 years ago

Aha!

I just tried switching to the Default login shell, (see the option in the screenshot above) and the ST3 Terminal package works perfectly, sending me to the correct place. So it must have something to do with me using the new version of BASH. I don't know how to fix the issue, however.

twolfson commented 5 years ago

Ah, interesting! Glad to hear you identified the problem =)

All our shell scripts start with a shebang for #!/bin/bash. Maybe that is causing issues when it encounters the custom shell and only executing in a subscript

Can you try duplicating the default Terminal.sh but updating #!/bin/bash to your custom path (or removing it entirely)?

Here's the file: https://github.com/wbond/sublime_terminal/blob/1.18.0/Terminal.sh

And instructions for how to set a custom script: https://github.com/wbond/sublime_terminal/tree/1.18.0#examples

Tim-at-AST commented 5 years ago

OK, I simply edited the Terminal.sh in the Packages folder, and used /opt/local/bin/bash and now all is working perfectly again. Problem solved.

Tim-at-AST commented 5 years ago

Are you able to delete some of the images I used above which have some of my info in them? I just realised how 'open' I've been and regret it.

Tim-at-AST commented 5 years ago

ok, was able to do it myself.

twolfson commented 5 years ago

Wonderful! Glad the issue has been resolved! Thanks for helping work with us through that =)