Giter VIP home page Giter VIP logo

termx's People

Contributors

315234 avatar afterdesign avatar ap0 avatar braver avatar fichtefoll avatar jtsternberg avatar jyshen15 avatar yongkangchen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

termx's Issues

Ability to set a default path

First of all, thanks for building this plugin. It's cool. I was wondering if there is way to set the default terminal path as the root of the project instead of the current file folder?

iTerm

Hi,

is there any way to launch iTerm 2 rather than the native Terminal app? It would be perfect!

Issue on ST3

Hi!
I'm getting an error when trying to open the terminal using ctrl+cmd+t 👍

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 418, in run_
    return self.run(edit)
  File "/Users/Peter/Library/Application Support/Sublime Text 3/Packages/MacTerminal/open_mac_terminal.py", line 55, in run
    subprocess.Popen(command)#pylint: disable-msg=E1101
  File "X/subprocess.py", line 818, in __init__
  File "X/subprocess.py", line 1416, in _execute_child
FileNotFoundError: [Errno 2] No such file or directory: 'osascript'

iTerm not opening

Hi,

First of all, thanks for MacTerminal.

I can't seem to get it to work with iterm2 beta. I get the following error (both in file and project mode):

'---MacTerminal DEBUG START---'
{'cmd': '/usr/bin/osascript /Users/M/Library/Application Support/Sublime Text 3/Packages/MacTerminal/macterminal_iterm-nightly.js /Users/M/Documents/code/stockio/.meteor',
 'directory_mode': 'file',
 'ext_language': 'js',
 'paths': ['/Users/M/Documents/code/stockio/.meteor'],
 'process_err': b'/Users/M/Library/Application Support/Sublime Text 3/Packages/MacTerminal/macterminal_iterm-nightly.js:0:1: script error: A \xe2\x80\x9c/\xe2\x80\x9d can\xe2\x80\x99t go here. (-2740)\n',
 'process_out': b''}
'---MacTerminal DEBUG END---'
reloading Packages/User/MacTerminal.sublime-settings
'---MacTerminal DEBUG START---'
{'cmd': '/usr/bin/osascript /Users/M/Library/Application Support/Sublime Text 3/Packages/MacTerminal/macterminal_iterm-nightly.js /Users/M/Documents/code/stockio',
 'directory_mode': 'project',
 'ext_language': 'js',
 'paths': ['/Users/M/Documents/code/stockio'],
 'process_err': b'/Users/M/Library/Application Support/Sublime Text 3/Packages/MacTerminal/macterminal_iterm-nightly.js:0:1: script error: A \xe2\x80\x9c/\xe2\x80\x9d can\xe2\x80\x99t go here. (-2740)\n',
 'process_out': b''}
'---MacTerminal DEBUG END---'

My settings file is

{
  "terminal":  "iterm-nightly",
  "directory_mode" : "project",
  "debug": true
}

Thanks for your help!

iTerm2: execution error: Error on line 13: Error: Parameter is missing.

Hi, thanks for the revamp - this hasn't worked for me for ages...

Now it works in Terminal.app, but not iTerm2 (preferred):

'---termX DEBUG START---'
{'paths': ['/projecct/templates/my_template']}
'---termX DEBUG END---'

'---termX DEBUG START---'
{'cmd': '/usr/bin/osascript /Users/username/Library/Application Support/Sublime Text 3/Packages/termX/termx_iterm.js /projecct/templates/my_template',
 'ext_language': 'js',
 'paths': ['/projecct/templates/my_template'],
 'process_err': b'/Users/username/Library/Application Support/Sublime Text 3/Packages/termX/termx_iterm.js:235:263: execution error: Error on line 13: Error: Parameter is missing. (-1701)\n',
 'process_out': b''}
'---termX DEBUG END---'

FYI, in Terminal, it opens a new window, then a new tab with the desired target... not sure if that's the intended behaviour.

Thanks for your efforts - let me know if I can supply more info / help test, etc!

MacTerminal does not open a terminal window on Sublime Text 2

Dear MacTerminal Author: I received the following message when I tried to use MacTerminal. As per the instructions in the message I am creating an issue.

This may be a bug, please create issue on github
['osascript', u'/Users/tnoe/Library/Application Support/Sublime Text 2/Packages/MacTerminal/macterminal_terminal.scpt']

Mac OS X 10.6.8 (10K549)
Model Name: Mac Pro
Model Identifier: MacPro1,1
Processor Name: Dual-Core Intel Xeon
Processor Speed: 2.66 GHz

Kind regards, Tom

Opens Iterm in home folder

Since upgrading to ST3, it keeps opening iTerm2 in my home folder. I have uninstalled / installed the package without luck. I have read all posts here and nothing seems to work. Your help would be appreciated as it worked like a charm before upgrading to ST3.

Can't select project subdir / iTerm opens before directory selection

Hi! tx for macterm.. love it daily!
This has worked for me until recently:

I expect:

  • trigger mac term while a project file is open,
  • see a ST3 prompt offering a selection of directories within the project (including project root)
  • select one
  • iTerm should open to that directory

What happens now:

  • trigger mac term while a project file is open,
  • iTerm is focussed
  • the ST3 prompt offering a selection of directories is flashed briefly onscreen, no chance to make a selection
  • iTerm opens cds to the directory of the currently open file

please check the screencast: https://memelab.wistia.com/medias/ol1xd1x7wg#media

User settings:

{
    "terminal" : "iterm",
    "directory_mode" : "project",
    "debug": true
}

I've got debug switched on:

---MacTerminal DEBUG START---
{'cmd': '/usr/bin/osascript/Users/timosborn/Library/Application Support/Sublime Text 3/Packages/MacTerminal/macterminal_iterm.js/Users/timosborn/Documents/Clients/Common-Code/Meerqat/Source/meteor/client/views/_styleguide',
 'directory_mode': 'project',
 'err': b'',
 'out': b'\n',
 'terminal_name': 'iterm'}
---MacTerminal DEBUG END---

Cannot start iterm correctly

If Iterm 2 is already started, then it can correctly initiate a new tab. However, if it's not, then it can not start Iterm 2. The same issue does not occur to the default terminal shipped with Mac. Here is the error message from the debug mode.

---MacTerminal DEBUG START---
{'cmd': u'/usr/bin/osascript/Users/zhangxiaowei/Library/Application Support/Sublime Text 2/Packages/MacTerminal/macterminal_iterm.scpt/Users/zhangxiaowei/Library/Application Support/Sublime Text 2/Packages/User',
'default_path': None,
'err': '/Users/zhangxiaowei/Library/Application Support/Sublime Text 2/Packages/MacTerminal/macterminal_iterm.scpt:243:251: script error: Expected class name but found identifier. (-2741)\n',
'out': '',
'terminal_name': u'iterm'}
---MacTerminal DEBUG END---

iTerm doesn't change directory

I have tried using both "terminal" and "iterm" and terminal works as expected but when I choose iterm (my primary terminal app) it opens a new tab but dumps me to the user's home directory. I do not have any configuration set other than the "terminal" setting.

Odd treatment of symbols

I noticed my $PS1 prompt was misrendered within termX.

Here is how it looks in iterm2:
image

But within termX, it looks like this:
image

But it doesn't seem limited to how to how it looks. If I try to copy the string with pbcopy<<<$PS1, I also get two different outputs.

iterm2:
�(B�[m�[7m🌮 SeñorCooley🌯 �(B�[m \w �[7m $?�(B�[m\n\$

termX:
�[0;10m�[7müåÆ Se√±orCooleyüåØ �[0;10mÓÇ∞ \w �[7mÓÇ∞ $?�[0;10mÓÇ∞\n\$

there is something wrong with iterm2 2.9. iterm open well but always in the ~ dir, not the dir my file in

'---MacTerminal DEBUG START---'
{'cmd': '/usr/bin/osascript /Users/guanxinxian/Library/Application Support/Sublime Text 3/Packages/MacTerminal/macterminal_iterm.js /Users/guanxinxian/Work/pro',
'directory_mode': 'file',
'ext_language': 'js',
'paths': ['/Users/guanxinxian/Work/pro'],
'process_err': b'/Users/guanxinxian/Library/Application Support/Sublime Text 3/Packages/MacTerminal/macterminal_iterm.js:418:495: execution error: Error on line 23: Error: \xe4\xbf\xa1\xe6\x81\xaf\xe6\x97\xa0\xe6\xb3\x95\xe8\xaf\x86\xe5\x88\xab\xe3\x80\x82 (-1708)\n',
'process_out': b''}
'---MacTerminal DEBUG END---'

Could not open a new terminal

Traceback (most recent call last):
  File "./sublime_plugin.py", line 362, in run_
  File "./open_mac_terminal.py", line 55, in run
TypeError: object of type 'NoneType' has no len()
Traceback (most recent call last):
  File "./sublime_plugin.py", line 362, in run_
  File "./open_mac_terminal.py", line 55, in run
TypeError: object of type 'NoneType' has no len()
no command for selector: noop:

I have these settings


{
   "terminal"   :  "iterm",
   "debug": true
}

readme git repo url is incorrect

Hi there,

Great package by the way!
Just one little suggestion, the git repo url in your readme is not the same as the actual repo url.

All the best,
John Paul

iterm cd not working

When I change the terminal to "iterm", it is not changing the directory to the where the file resides. It is at /Users/name/.
However it is working fine with "terminal".

I have sublime text 2 running on macbook. I appreciate any help.

Cannot start

Hello I just installed your plugin and in console I got:

reloading plugin MacTerminal.open_mac_terminal
found 7 files for base name Default.sublime-keymap
found 6 files for base name Main.sublime-menu
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 549, in run_
    return self.run(edit)
  File "open_mac_terminal in /Users/bartas/Library/Application Support/Sublime Text 3/Installed Packages/MacTerminal.sublime-package", line 55, in run
TypeError: object of type 'NoneType' has no len()
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 549, in run_
    return self.run(edit)
  File "open_mac_terminal in /Users/bartas/Library/Application Support/Sublime Text 3/Installed Packages/MacTerminal.sublime-package", line 55, in run
TypeError: object of type 'NoneType' has no len()

Mountain Lion issue

In Mountain Lion, the Applescript scripts didn't work for me. I played around with the terminal app and was able to get it to work with the attached script. I don't know if this is the best solution, but it's one that worked for me.

on run argv
    -- Don't set if no path to use
    if count of argv is 1 then
        set folderName to item 1 of argv -- Folder path
    end if

    tell app "System Events"
        set testProps to properties of disk item (folderName)
        if class of testProps is not folder then
            set myFile to (POSIX file folderName) as alias
            set folderName to POSIX path of container of myFile
        end if
    end tell

    tell application "Terminal"
        set windowsCount to (count of windows)
        activate

        if folderName is not missing value then
            set commandToRun to "cd " & quoted form of (folderName as string)

            if windowsCount is not 0 then
                do script commandToRun
            else
                do script commandToRun in window 0
            end if

            do script "clear" in window 0
        end if
    end tell
end run 

Can't get termX to activate

I've been using MacTerminal for some time but lately it's been acting up by not cd:ing into the folder that I'm currently in.
So today I decided to try some alternatives and removed MacTerminal, but in lack of anything better I tried installing it again via Package Control. Of course that didn't work since it's been renamed to termX (and is currently not available from Package Control?), so I manually cloned the master branch (652aed4) into my Packages folder.

Now I can't get the open_termx_terminal command to do anything at all. Running the command manually in the console does nothing either. Also I don't see anything related to termX in the command palette.

I'm using Sublime Text, Stable Channel, build 3114

image

doesn't work in ST3

I just got the plugin - live the idea. But i can't get it working.

The right click menu is there - but nothing happens when I ry to get a file to open in terminal.
Here is debug:
reloading Packages/User/MacTerminal.sublime-settings
Writing file /Users/leeblazek/Library/Application Support/Sublime Text 3/Packages/User/MacTerminal.sublime-settings with encoding UTF-8 (atomic)
reloading Packages/User/MacTerminal.sublime-settings
Writing file /Users/leeblazek/Library/Application Support/Sublime Text 3/Packages/User/MacTerminal.sublime-settings with encoding UTF-8 (atomic)
reloading Packages/User/MacTerminal.sublime-settings
---MacTerminal DEBUG START---
{'cmd': '/usr/bin/osascript/Users/leeblazek/Library/Application Support/Sublime Text 3/Packages/MacTerminal/macterminal_iterm.scpt/Users/leeblazek/node_stuff/strongloop/webtest',
'default_path': None,
'err': b'osascript: /Users/leeblazek/Library/Application Support/Sublime Text 3/Packages/MacTerminal/macterminal_iterm.scpt: No such file or directory\n',
'out': b'',
'terminal_name': 'iterm'}
---MacTerminal DEBUG END---

Any Ideas much appreciated

Readme.md needs updating

Problem:

  1. termx.sublime-settings does not work, actually, when I looked at the source code, the settings file is still hardcoded as MacTerminal.sublime-settings
  2. the command is not open_terminal, again, in the source code, the correct command is open_mac_terminal.

Old setting file is being loaded

I noticed that termX seems to load the settings file named after the old plugin name MacTerminal.sublime-settings (Source).
But when accessing the settings file from the main menu it points to the new name termX.sublime-settings (Source)

No command in palette

Some of us use the command palette extensively and specially for less frequently used commands it is a must to have them available there as well, so it doesn't become necessary to memorize a million of different shortcuts.

Do you think it would be possible to add this?

Thanks a lot!

Terminal won't open

---MacTerminal DEBUG START---
{'cmd': '/usr/bin/osascript/Users/xxxx/Library/Application Support/Sublime Text 3/Packages/MacTerminal/macterminal_terminal.scpt/Volumes/User HD/Documents/ltserver',
'directory_mode': 'default',
'err': b'/Users/xxxx/Library/Application Support/Sublime Text 3/Packages/MacTerminal/macterminal_terminal.scpt:272:314: execution error: Terminal got an error: Can\xe2\x80\x99t get window 1 whose frontmost = true. Invalid index. (-1719)\n',
'out': b'',
'terminal_name': 'terminal'}
---MacTerminal DEBUG END---

Terminal won't open when Terminal is already run without any window.
Mac os x 10.9.1 ST3

Not changing directory with iTerm

Hi! Keep getting this error:

'---MacTerminal DEBUG START---'
{'cmd': '/usr/bin/osascript /Users/akella/Library/Application Support/Sublime Text 3/Packages/MacTerminal/macterminal_iterm.scpt /Users/akella/Desktop/git',
 'directory_mode': 'project',
 'ext_language': 'scpt',
 'paths': ['/Users/akella/Desktop/git'],
 'process_err': b'/Users/akella/Library/Application Support/Sublime Text 3/Packages/MacTerminal/macterminal_iterm.scpt:425:433: script error: Expected end of line but found identifier. (-2741)\n',
 'process_out': b''}
'---MacTerminal DEBUG END---'

But if i remove this part http://take.ms/oFA0J, works ok.
10.11 El Capitan, Sublime Text 3, Build 3083

"Message not understood" when using iTerm

When using the following configuration, with iTerm:

{
      "directory_mode" : "project",
      "terminal"   :  "iterm"
  }

iTerm simply opens my default directory, rather than the project directory. I get the following error in the Sublime console:

'---MacTerminal DEBUG START---'
{'cmd': '/usr/bin/osascript /Users/shankie/Library/Application Support/Sublime Text 3/Packages/MacTerminal/macterminal_iterm.js /Users/shankie/Sites/proper-build',
 'directory_mode': 'project',
 'ext_language': 'js',
 'paths': ['/Users/shankie/Sites/proper-build'],
 'process_err': b'/Users/shankie/Library/Application Support/Sublime Text 3/Packages/MacTerminal/macterminal_iterm.js:418:495: execution error: Error on line 23: Error: Message not understood. (-1708)\n',
 'process_out': b''}
'---MacTerminal DEBUG END---'

Any ideas? Cheers!

Greyed out

Hi,

The "Open in Terminal" menu option is greyed out. Is there something I'm missing?

Open two tabs by default if iTerm is not running

You can see the issue as the picture shown below
image

I have changed macterminal_iterm.scpt as below and it seems to work well:

on is_running(appName)
    tell application "System Events" to (name of processes) contains appName
end is_running

on run argv
    set _isRunning to is_running("iTerm")
    set _cwd to item 1 of argv

    tell application "iTerm"
        make new terminal
        tell the current terminal
            activate current session
            if _isRunning then
                launch session "Default Session"
            end if
            tell the last session
                write text "pushd " & _cwd & ";clear;pwd"
            end tell
        end tell
        activate
    end tell
end run

iterm or terminal not opening the directory

When i hit ctrl+cmd+t it opens terminal with my home directory(default terminal state)
The console log for the debug is as follows

---MacTerminal DEBUG START---
{'cmd': u'/usr/bin/osascript/Users/rajesh/Library/Application Support/Sublime Text 2/Packages/MacTerminal/macterminal_iterm.scpt/Users/rajesh/www/ahead/kanaan/website',
'directory_mode': u'project',
'err': '',
'out': '',
'terminal_name': u'iterm'}
---MacTerminal DEBUG END---

Doesn't work

Here is the output in console:

Traceback (most recent call last):
File "./sublime_plugin.py", line 362, in run_
File "./open_mac_terminal.py", line 30, in run
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/posixpath.py", line 119, in dirname
AttributeError: 'NoneType' object has no attribute 'rfind'

iterm2 not opening in home folder

ctr+cmd+t opens a new tab in iterm2, but it opens it in my home folder rather than the current file's directory or the project directory. I've tried it with directory_mode set to both project and default. Here's my user config:

{
    "terminal" : "iterm",
    "debug" : true,
    "directory_mode" : "project"
}

and here's the debug output:

---MacTerminal DEBUG START---
{'cmd': '/usr/bin/osascript/Users/janusz/Library/Application Support/Sublime Text 3/Packages/MacTerminal/macterminal_iterm.scpt/Users/janusz/git/omx-utils',
 'directory_mode': 'project',
 'err': b'',
 'out': b'',
 'terminal_name': 'iterm'}
---MacTerminal DEBUG END---

I installed the package using Package Control. Also, the path to osascript is correct.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.