wbond / sublime_terminal

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

CommandNotFoundException #151

Closed golamSaroar closed 7 years ago

golamSaroar commented 7 years ago

I get the following every time I open Terminal on ST3 (Windows10).

\PS.ps1 : The term '\PS.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ \PS.ps1
+ ~~~~~~~
    + CategoryInfo          : ObjectNotFound: (\PS.ps1:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

It doesn't stop me from doing my work. I get this in the immediate next line: PS C:\xampp\htdocs\laravel>

But I can not use some other commands like PS C:\xampp\htdocs\laravel>subl "sublime_text_file_name" to open that file from Terminal. All these used to work really well before I upgraded to Version 3.

I will be grateful if somebody can help me here.

twolfson commented 7 years ago

The issue seems to be appearing from the sublime_terminal_path environment variable not being found. We introduce this via the code so it shouldn't be a problem:

https://github.com/wbond/sublime_terminal/blob/1.16.0/Terminal.py#L83-L85

How long have you been experiencing this issue for?

golamSaroar commented 7 years ago

I have been experiencing this issue since I upgraded to Sublime Text 3 on Sunday.

Can you tell me how can I fix this?

twolfson commented 7 years ago

Hmm, we introduced a change to how we handle environment variables on Sunday so that might be linked with the issue. What currently happens when you try using Terminal in Sublime Text 2 after the package upgrades?

twolfson commented 7 years ago

After doing some local exploring, it looks like putenv doesn't modify os.environ so our update isn't picking up the patched environ. I'm going to explore fixing this properly

https://docs.python.org/2/library/os.html#os.environ

twolfson commented 7 years ago

Alright, we introduced a patch in 1.16.1. Powershell support should be back to functional once Package Control sees the change and it downloads locally to your Sublime Text instance. Thanks for reporting bug report =)

golamSaroar commented 7 years ago

Thanks a lot :)