Actually I've done with this answer: Marslo Answer, it's work fine open CMD from right click in sublime text 3.
but I've some question about this script,
import os, sublime_plugin
class CmdCommand(sublime_plugin.TextCommand):
def run(self, edit):
file_name=self.view.file_name()
path=file_name.split("\\")
current_driver=path[0]
path.pop()
current_directory="\\".join(path)
command= "cd "+current_directory+" & "+current_driver+" & start cmd"
os.system(command)
how can I get the filename of current file when i open cmd from self file in cmd output?
basicly the opened cmd with script above is like this:
C:\Users\myuser\Desktop>
How to make a opened cmd output like this:
C:\Users\myuser\Desktop>php myfile.php
or:
C:\Users\myuser\Desktop>py myfile.py
so, I can run the script without typing "php myfile.php",
on another reason if my script is require arguments, when cmd is showing I just type the arguments, like this:
C:\Users\myuser\Desktop>php myfile.php IcanTypingArg1 IcanTypingArg2
and than just press enter to run this script.
Anyone can help me to solve this?
I'm sorry for my english.