Solution for Sublime Text 2 is here Sublime Text 2 - Open CMD prompt at current or project directory (Windows) .But this script is not working in ST3.
Open any program file in the sublime editor and Right-click (context menu). You can see the Cmd menu in the Context menu options. Click on it. The command prompt will be opened through which you can compile and run your program.
That's all for adding the WIndows 10 open command prompt. When you press shift and right-click anywhere on your windows background, you will have an option of 'Open command window here' as shown in the following screenshot from Windows 10.
Use Ctrl + ' to open the console. When Ctrl + ` is pressed, Sublime Text does not receive anything.
A simpler solution is to install SublimeREPL, there is a shell REPL. You can add keymap to your user config. However this open the shell inside Sublime.
If your prefer, the old script is still working. Instead of put them(cmd.py
& Context.sublime-menu
) in a cmd
directory, you put them under Cmd
directory, which should be capitalized.
And I simplified the script, here:
import os, sublime_plugin
class CmdCommand(sublime_plugin.TextCommand):
def run(self, edit):
path, _ = os.path.split(self.view.file_name())
os.chdir(path)
os.system('cmd')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With