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

Fail to transfer code to REPL by shortcut key #312

Open
renkun-ken opened this issue Jan 2, 2014 · 8 comments
Open

Fail to transfer code to REPL by shortcut key #312

renkun-ken opened this issue Jan 2, 2014 · 8 comments

Comments

@renkun-ken
Copy link

I installed REPL in ST3 and set a shortcut key to evaluate code in a more convenient way

{
    "keys": [
        "ctrl+shift+enter"
    ],
    "args": {
        "scope": "selection"
    },
    "command": "repl_transfer_current"
}

I open a REPL windows in (for example) R, and edit a code file in R too. When I press the shortcut key nothing happens. I use the menu command to transfer the selected code to REPL and still nothing happens. I tried R, F#, Python and none of them work. I'm sure that I have perfectly correct installation of R, F#, and Python interpreter/compiler and set the correct PATH variable if needed. I wonder why this does not work?

@wuub
Copy link
Owner

wuub commented Jan 2, 2014

Turn on

   sublime.log_commands(True)

press ctrl+shift+enter and see if anything is logged in the console.

@renkun-ken
Copy link
Author

Thanks, @wuub! I tracked the command log. When I select the code and hit the shortcut I get this:

command: repl_transfer_current {"scope": "selection"}
Traceback (most recent call last):
File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 543, in run_
return self.run(edit, **args)
File "C:\Users\Kun\AppData\Roaming\Sublime Text 3\Packages\SublimeREPL\text_transfer.py", line 123, in run
for rv in manager.find_repl(external_id):
File "C:\Users\Kun\AppData\Roaming\Sublime Text 3\Packages\SublimeREPL\sublimerepl.py", line 437, in find_repl
if not (rv.repl and rv.repl.is_alive()):
File "C:\Users\Kun\AppData\Roaming\Sublime Text 3\Packages\SublimeREPL\repls\subprocess_repl.py", line 185, in is_alive
return self.popen.poll() is None
File "X/subprocess.py", line 916, in poll
File "X/subprocess.py", line 1131, in _internal_poll
OSError: [WinError 6] The handle is invalid

It seems that something wrong with the handle?

@wuub
Copy link
Owner

wuub commented Jan 2, 2014

Windows 8?

@renkun-ken
Copy link
Author

Windows 8.1.

I tried running ST3 as Administrator and it works occasionally but mostly it does not work.

@renkun-ken
Copy link
Author

It sometimes works for the first time in a ST session. If I close the REPL and open another one, the transfer no longer works and the log shows the same error information.

@wuub
Copy link
Owner

wuub commented Jan 2, 2014

Can you try this fork (using a portable ST3 installation) https://github.com/simonzack/SublimeREPL

@renkun-ken
Copy link
Author

I download a portable ST3 and download the https://github.com/simonzack/SublimeREPL fork and extract the contents to (ST3)/data/packages/user/SublimeREPL. I open Portable ST3 and it recognizes this package but all menu items are disabled.
How do I install a package from another fork?

@sjianlyer
Copy link

I have the same problem some hours ago, finally, I think it has been solved.
When I use the menu Tools -> sublimeREPL -> R to open R console, the shortcut never works whatever it is. Following some suggestions, I use the command "sublime.log_commands(True)" to track what happend, but just error code. Occasionally, I found that after execute any code in opened R console by inputing, the shortcut works. It seemd that the REPL R session is not actived when I use the menu to open it. So I set another shortcut to open R console, super!, it worked. So far, it works normally. The shortcut to open REPL R session is:
{ "keys": ["ctrl+shift+r"],
"caption": "SublimeREPL: R",
"command": "run_existing_window_command", "args":
{
"id": "repl_r",
"file": "config/R/Main.sublime-menu"
}
}

My environment is Win10 64bit, portable sublime text 2, R 3.1.3 64bit
There is really very few answer online for this problem, hope it's helpful.

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

No branches or pull requests

3 participants