>> Popen(['xterm', '-e', '/bin/bash', '--login', '-c', 'pushd %s; bash'%path])
ok, that led to a more fruitful path {heheh}, this works:
Popen(['xterm', '-e', '/bin/bash'], cwd=path)
I leaned of the `cwd` parameter from
http://www.python.org/dev/peps/pep-0324/. There talk in there of
`shell=True` also which might be appropriate here, but it's
accompanied by dire warnings of security troubles so I didn't play
with it.
Thanks for the xterm idea. It's always annoyed me that the "shell
here" had to use the same console which started Leo. I changed xterm
to gnome-terminal on Ubuntu, and more iterations led to the short and
sweet:
Popen('gnome-terminal', cwd=path)
I tried using just `/bin/sh` so the button would not depend on the
flavour of linux, but that opens a shell with no feedback for current
working directory etc.
-----
And here's how to do the same thing for Windows:
Popen('cmd.exe /c "start cmd.exe"', cwd=path)
The first cmd starts, opens a new cmd shell in a new window, then
closes ("/c"). This trickery is needed because "start" is a builtin
resident command of the shell (cmd.exe).
...time passes...it turns out the below appears to be functionally
equivalent. I personally can't see how this is less secure than the
previous, so it's what I'll use now. The "shell from Leo" is optional,
so I can tell from the window title that this particular shell will
have python etc. active (my default shell does not).
Popen('start "Shell from Leo" cmd.exe', cwd=path, shell=True)
cheers,
-matt
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/leo-editor?hl=en.