A button to open a command shell at the `@path` location of the active node


Create node with the headline @button CMD here, give it the contents below, save and reopen Leo:

'''Open a windows cmd.exe prompt in the path of the currently selected node.
A mapped drive letter will be created for a UNC path.

more info: http://leo.zwiki.org/CommandShellHere/

d = c.scanAllDirectives(p)
# g.es(g.dictToString(d))   #uncomment to show results of above in log pane

path = d.get('path')
name = p.anyAtFileNodeName()
if name:
   name = g.os_path_finalize_join(path,name)

from subprocess import Popen
Popen('start "Shell from Leo" cmd.exe', cwd=path, shell=True)


As for Windows, but change the last line to one of:

Popen('gnome-terminal', cwd=path) # debian, ubuntu
Popen('xterm', cwd=path)          # any 'nix