fix: avoid VM name collisions in recovery commands
This commit is contained in:
+4
-4
@@ -210,21 +210,21 @@ def session_helper(command: str, manifest: Path) -> int:
|
||||
if command == 'recover':
|
||||
print('HydraOS local recovery. VMs keep running independently.\n'
|
||||
'Ctrl+Alt+Shift+Left/Right switches workspaces; Ctrl+Alt+Shift+R releases input; Ctrl+Alt+Shift+U opens USB.\n'
|
||||
'Enter a VM name to reconnect, s for a host shell, q to close this terminal.')
|
||||
'Enter a VM name to reconnect, :shell for a host shell, :quit to close this terminal.')
|
||||
while True:
|
||||
try:
|
||||
print(json.dumps([runtime.status(name) for name in data['names']], indent=2))
|
||||
choice = input('hydra recovery> ').strip()
|
||||
except (EOFError, KeyboardInterrupt):
|
||||
return 0
|
||||
if choice == 'q':
|
||||
if choice == ':quit':
|
||||
return 0
|
||||
if choice == 's':
|
||||
if choice == ':shell':
|
||||
subprocess.run([os.environ.get('SHELL', '/bin/sh')])
|
||||
elif choice in data['names']:
|
||||
subprocess.Popen(_module_argv('reconnect:' + choice, manifest), start_new_session=True)
|
||||
else:
|
||||
print('Enter a configured VM name, s, or q.')
|
||||
print('Enter a configured VM name, :shell, or :quit.')
|
||||
if command.startswith('reconnect:'):
|
||||
name = command.split(':', 1)[1]
|
||||
# One viewer per VM inside this session; independent host view commands
|
||||
|
||||
Reference in New Issue
Block a user