How to open iTerm in sublime text 3?

I installed the terminal package in sublime3 installed in the package:

{ "terminal": "iTerm.sh", "parameters": [] } 

But when I press the command + shift + T buttons together, there is no answer, why?

+5
source share
3 answers

For iTerm2 on Sublime Text 3 with Terminal Pack, follow these steps:

  • In Sublime 3, go to Preferences > Package Settings > Terminal > Settings - User

Paste the following and save:

 { "terminal": "iTerm2-v3.sh", "parameters": ["--open-in-tab"] } 

Open the test project folder on iTerm2 with cmd + shift + T (Work on Sublime 3 build 3131)

Link to the terminal website:

enter image description here

+9
source

It is hard to say without additional information. However, a good way to debug such problems is to look in the console. To open the elevated console, press Ctrl + ` or select" View "β†’" Show Console "in the main menu. Now click the shortcut again and see if any debug message is displayed.

If you suspect that something is wrong with the keywords, you can run view.run_command('open_terminal') from the console. This is the command that is issued on cmd+shift+t (see package configuration file .)

As a note. I did not know that this package exists, instead I wrote a few lines to do just that. This can be useful if you want to play using the terminal or the same yourself.

 import sublime_plugin, subprocess class OpenTerminal(sublime_plugin.TextCommand): def run (self, edit): if self.view.file_name(): cwd = '/'.join(self.view.file_name().split('/')[:-1]) else: cwd = self.view.window().project_data()['folders'][0]['path'] subprocess.Popen(['xfce4-terminal', '--working-directory=' + cwd]) 
0
source

Download this shell script and add it to your system path named iTerm2-v3.sh . Make sure you have iTerm> = 3.0.4 or even better, the latest iTerm2-v3. Go to Preferences > Package Settings > Terminal > Settings - User . Your settings file should look like this.

 { "terminal": "iTerm2-v3.sh", "parameters": ["--open-in-tab"] } 

In addition, double-checking a shortcut is not overridden by another command. Press Cmd+Shift+P and enter Terminal: Open

That should work. ITerm may not activate, you need to switch to iTerm2 and check if the current folder in Sublime is open on a new tab in iTerm2.

0
source

All Articles