Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$input crashes command #4

Closed
stjernegard opened this issue Oct 5, 2015 · 5 comments
Closed

$input crashes command #4

stjernegard opened this issue Oct 5, 2015 · 5 comments
Assignees
Labels

Comments

@stjernegard
Copy link

Whenever I use $input in a command, it crashes.

[
  {
    "caption": "Git: Checkout Branch",
    "command": "commando",
    "args": {
      "commands": [
       ["commando_input_panel", {
          "caption": "Branch name: ",
          "initial_text": "master",
          "on_done": [
            ["commando_exec", {"cmd": ["git", "checkout", "$input"]}]
          ]
        }]
      ]
    }
  }
]

I would expect this command to check out a new branch. Instead it fails:

Exception in thread Thread-12:
Traceback (most recent call last):
  File "./threading.py", line 901, in _bootstrap_inner
  File "commands in /Users/dannistjernegard/Library/Application Support/Sublime Text 3/Installed Packages/Commando.sublime-package", line 274, in run
  File "./subprocess.py", line 824, in __init__
  File "./subprocess.py", line 1386, in _execute_child
TypeError: Can't convert 'NoneType' object to str implicitly

Traceback (most recent call last):
  File "commands in /Users/dannistjernegard/Library/Application Support/Sublime Text 3/Installed Packages/Commando.sublime-package", line 86, in watch_proc
  File "commands in /Users/dannistjernegard/Library/Application Support/Sublime Text 3/Installed Packages/Commando.sublime-package", line 308, in poll
AttributeError: 'NoneType' object has no attribute 'poll'
@ericpridham ericpridham added the bug label Oct 6, 2015
@ericpridham ericpridham self-assigned this Oct 6, 2015
@ericpridham
Copy link
Owner

@stjernegard I can only seem to reproduce this error if I explicitly translate "$input" to None, so I'm curious about the exact commands. Can you open up the console and enter sublime.log_commands(True) then re-run the command above and paste to me the relevant command log?

@stjernegard
Copy link
Author

@ericpridham

The relevant part of the log:

command: show_overlay {"overlay": "command_palette"}
command: commando {"commands": [["commando_input_panel", {"caption": "Branch name: ", "initial_text": "master", "on_done": [["commando_exec", {"cmd": ["git", "checkout", "$input"]}]]}]]}
command: commando_input_panel {"context": {"args": {"caption": "Branch name: ", "initial_text": "master", "on_done": [["commando_exec", {"cmd": ["git", "checkout", "$input"]}]]}, "commands": [], "input": null, "view_id": 20, "window_id": 2}}
command: commando_exec {"context": {"args": {"cmd": ["git", "checkout", "$input"]}, "commands": [], "input": null, "view_id": 20, "window_id": 2}}
Exception in thread Thread-13:
Traceback (most recent call last):
  File "./threading.py", line 901, in _bootstrap_inner
  File "commands in /Users/dannistjernegard/Library/Application Support/Sublime Text 3/Installed Packages/Commando.sublime-package", line 274, in run
  File "./subprocess.py", line 824, in __init__
  File "./subprocess.py", line 1386, in _execute_child
TypeError: Can't convert 'NoneType' object to str implicitly

Traceback (most recent call last):
  File "commands in /Users/dannistjernegard/Library/Application Support/Sublime Text 3/Installed Packages/Commando.sublime-package", line 86, in watch_proc
  File "commands in /Users/dannistjernegard/Library/Application Support/Sublime Text 3/Installed Packages/Commando.sublime-package", line 308, in poll
AttributeError: 'NoneType' object has no attribute 'poll'

@ericpridham
Copy link
Owner

@stjernegard Excellent, thanks for that. Looks like I had this fixed in master but never did a release for it. I just did a 0.2.2 release which should hit package control shortly.

@ericpridham
Copy link
Owner

@stjernegard Hey, I'm just wondering if release 0.2.2 fixed your issue.

@stjernegard
Copy link
Author

Yea, it works now, thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants