drop to shell in foldermenu
This commit is contained in:
@@ -27,7 +27,7 @@ def setup_options():
|
|||||||
"Menufile format for each line: 'description:command'. " +
|
"Menufile format for each line: 'description:command'. " +
|
||||||
"If the command ends in '&' it is run in the background. " +
|
"If the command ends in '&' it is run in the background. " +
|
||||||
"If the command ends in '/' it is a folder, and selecting will enter. " +
|
"If the command ends in '/' it is a folder, and selecting will enter. " +
|
||||||
"Extra keyboard shortcuts: / Edit ")
|
"Extra keyboard shortcuts: / Edit, $ Shell ")
|
||||||
parser.add_argument("-1","--one-shot",action = 'store_true', dest = 'once', default = False,
|
parser.add_argument("-1","--one-shot",action = 'store_true', dest = 'once', default = False,
|
||||||
help = "Launch only once, then exit")
|
help = "Launch only once, then exit")
|
||||||
parser.add_argument("-b","--no-banner", action='store_false', dest='banner', default=True,
|
parser.add_argument("-b","--no-banner", action='store_false', dest='banner', default=True,
|
||||||
@@ -500,6 +500,18 @@ class entry_collection:
|
|||||||
)
|
)
|
||||||
self.initialize()
|
self.initialize()
|
||||||
|
|
||||||
|
def shell(self):
|
||||||
|
#env = os.environ.copy()
|
||||||
|
#env["PS1"] = "fM:" + env.get("PS1","")
|
||||||
|
subprocess.call(
|
||||||
|
"bash --rcfile <(cat ~/.bashrc; echo \"PS1='folderMenu: '\$PS1\") -i",
|
||||||
|
stderr = subprocess.STDOUT,
|
||||||
|
shell = True,
|
||||||
|
executable = "/bin/bash"
|
||||||
|
)
|
||||||
|
self.initialize()
|
||||||
|
|
||||||
|
|
||||||
def debug_code_print(c):
|
def debug_code_print(c):
|
||||||
print("- code: %d, str: %s -"%(
|
print("- code: %d, str: %s -"%(
|
||||||
c,
|
c,
|
||||||
@@ -569,6 +581,8 @@ def start_engines():
|
|||||||
entries.flip_mode()
|
entries.flip_mode()
|
||||||
if inkey == 47: # /
|
if inkey == 47: # /
|
||||||
entries.edit_menu()
|
entries.edit_menu()
|
||||||
|
if inkey == 36: # $
|
||||||
|
entries.shell()
|
||||||
if inkey == 13: # enter
|
if inkey == 13: # enter
|
||||||
inkey = ord(entries.menu_keys[entries.selected])
|
inkey = ord(entries.menu_keys[entries.selected])
|
||||||
found, message = entries.is_key(chr(inkey))
|
found, message = entries.is_key(chr(inkey))
|
||||||
|
|||||||
Reference in New Issue
Block a user