import sublime, sublime_plugin, subprocess, os

class open_cmd(sublime_plugin.TextCommand):
	def run(self, edit):
		directory = os.path.dirname(self.view.file_name())
		retcode = subprocess.Popen(["cmd", "/K",  'color 02 && title POSEIDON TOOLS & cd '+directory+' & echo off & echo current directory: %cd% & echo this CMD is now active... Enter your command:'])

	def is_enabled(self):
		return self.view.file_name() and len(self.view.file_name()) > 0