Sublime Forum

The new build won't let me use a keybinding to run SublimeREPL

#1

Hi, I updated to the new build today, and my user defined keybinding to run SublimeREPL on the current window stopped working. When I uninstalled it and downgraded back to the previous version, it immediately started working again. Is there a fix available?
Thanks

5 Likes

Python - RUN Current file
#2

What platform are you on, and what key binding are you trying to use? Does SublimeREPL work when invoked without a key binding? I think I saw someone say it isn’t working properly with 3.2.

1 Like

#3

Win 10, same problem. My key binding:

[
  {
    "keys": ["f1"],
    "caption": "SublimeREPL: Python - IPython",
    "command": "run_existing_window_command",
    "args":
    {
      "id": "repl_python_ipython",
      "file":"config/python/Main.sublime-menu"
    }
  },
  {
    "keys": ["f2"],
    "caption": "SublimeREPL: Python",
    "command": "run_existing_window_command",
    "args":
    {
      "id": "repl_python",
      "file":"config/python/Main.sublime-menu"
    }
  },
  {
    "keys":["f5"],
    "caption": "SublimeREPL: Python - RUN current file",
    "command": "run_existing_window_command",
    "args":
    {
      "id": "repl_python_run",
      "file": "config/Python/Main.sublime-menu"
    }
  },
]

SublimeREPL works well without key binding, and only these three keys above not work.

0 Likes

#4

same here
i used to use this also the same code to run SublimeREPL in Windows but since i updated sublime i can’t more used:
{
“target”: “run_existing_window_command”,
“id”: “repl_python_run”,
“file”: “config/Python/Main.sublime-menu”
}

0 Likes

#5

I also noticed that SublimeREPL work well in menu(Tools -> SublimeREPL), but not work with command in ctrl+shift+p.

0 Likes

#6

I have the same problem…the tool goes well but the key bindings is dead

0 Likes

#7

Hmm, I just added this to my keybinding file and it works (macOS 10.14, ST build 3200):

{
    "keys": ["f2"],
    "caption": "SublimeREPL: Python",
    "command": "run_existing_window_command",
    "args":
    {
      "id": "repl_python",
      "file":"config/python/Main.sublime-menu"
    }
  }

Have you tried uninstalling SublimeREPL and reinstalling it?

0 Likes

#8

What file did you have this in?

0 Likes

#9

I am learning to program, and the same error happens to me since I update

0 Likes

#10

to Setup Sublime Text 3 with Python and interactive mode
check out this video : https://www.youtube.com/watch?v=rIl0mmYSPIc

0 Likes

#11

Can you indicate here where you put it so I don’t have to watch the video?

0 Likes

#12

7:20 to 8:45

0 Likes

#13

It’s in the comments for the video. It’s an ST Build system, Where he put it, I don’t know.

0 Likes

#14

OK, so I am having the same issue, also on Win10. Prior to the update, I had

{
	"target": "run_existing_window_command", 
	"id": "repl_python_run",
	"file": "config/Python/Main.sublime-menu"
}

as a build system, saved as PyREPL.sublime-build, located at [user]\AppData\Roaming\Sublime Text 3\Packages\User; this is as described here. This always seemed somewhat hacky, but had been working. I understand that SublimeREPL is no longer under active development, but I just haven’t found a viable replacement (or a way to just launch the script in IDLE). .py scripts will execute with the default python build system, and manually selecting Tools->SublimeREPL->Python->Python - RUN Current File works as normal. I have re-installed SublimeREPL twice, the second time I went as far as re-installing Package Control as well. I also attempted using

[
{ "keys": ["ctrl+shift+."], "command": "run_existing_window_command", "args":
        {
        "id": "repl_python_run",
        "file": "config/Python/Main.sublime-menu"
        }
} 
]

as a user defined keybind, in the .sublime-keymap for user.

As a (very) hacky shortcut until this is fixed, I just created an autohotkey script bound to ctrl+alt+b and recorded the needed combo of arrow keys. However, I would much prefer to not have to deal with this as a long-term solution.

0 Likes

#15

What platform are you all running? I am able to get a custom KeyBinding to open SublimeREPL without issue.

Could you also look in your console to see if there are any Python errors?

0 Likes

#16

Win 10, python 3.7

I have examined the console, I do not get any errors either on startup or build.

0 Likes

#17

I met same question.But I find a temporary resolvent.:grin:

{
    "keys": ["f5"],
   "command": "repl_open",
                 "caption": "Python - RUN current file",
                 "id": "repl_python_run",
                 "mnemonic": "R",
                 "args": {
                    "type": "subprocess",
                    "encoding": "utf8",
                    "cmd": ["python", "-u", "$file_basename"],
                    "cwd": "$file_path",
                    "syntax": "Packages/Python/Python.tmLanguage",
                    "external_id": "python",
                    "extend_env": {"PYTHONIOENCODING": "utf-8"}
}}

my key is “f5”.Please set key that you like by yourself.
I think command( run_existing_window_command ) of sublimerepl is no valid possible after new sublime (3.2) updated.

2 Likes

#18

I also meet this problem. I found a way to save it.
{
“keys”: [“f5”],
“command”: “repl_open”,
“caption”: “Python - RUN current file”,
“id”: “repl_python_run”,
“mnemonic”: “R”,
“args”: {
“type”: “subprocess”,
“encoding”: “utf8”,
“cmd”: [“python”, “-u”, “$file_basename”],
“cwd”: “$file_path”,
“syntax”: “Packages/Python/Python.tmLanguage”,
“external_id”: “python”,

                    }
                }
0 Likes

#19

I tried this also but its not working

0 Likes

#20

It seems some users are trying to use a build system sublime repl, whereas other are having issues with key bindings. So far it appears everyone who is having trouble is using Windows?

1 Like