]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Fix stdin being redirect to /dev/null when running ssh, shell or qemu
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 21 Apr 2023 09:51:20 +0000 (11:51 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 21 Apr 2023 09:54:53 +0000 (11:54 +0200)
30b8996a22022289bbf9820b6a04c5bfaf771d5e changed the default of
stdin to /dev/null, which is great, but for the ssh, shell, boot and
qemu commands, we actually need it connected to stdin of the calling
terminal, so let's fix that.

mkosi/__init__.py

index 12db7bfbe87c6d38f9d425d79da73a4fc9c914b4..aa15cf0a9e19391fbb568d1129560f9e623bbe09 100644 (file)
@@ -1987,7 +1987,7 @@ def run_shell(config: MkosiConfig) -> None:
         acl_toggle_remove(config, config.output, uid, allow=False)
 
     try:
-        run(cmdline, stdout=sys.stdout, env=os.environ, log=False)
+        run(cmdline, stdin=sys.stdin, stdout=sys.stdout, env=os.environ, log=False)
     finally:
         if config.output_format == OutputFormat.directory:
             acl_toggle_remove(config, config.output, uid, allow=True)
@@ -2240,7 +2240,7 @@ def run_qemu(config: MkosiConfig) -> None:
         cmdline += config.qemu_args
         cmdline += config.cmdline
 
-        run(cmdline, stdout=sys.stdout, env=os.environ, log=False)
+        run(cmdline, stdin=sys.stdin, stdout=sys.stdout, env=os.environ, log=False)
 
 
 def run_ssh(config: MkosiConfig) -> None:
@@ -2256,7 +2256,7 @@ def run_ssh(config: MkosiConfig) -> None:
 
     cmd += config.cmdline
 
-    run(cmd, stdout=sys.stdout, env=os.environ, log=False)
+    run(cmd, stdin=sys.stdin, stdout=sys.stdout, env=os.environ, log=False)
 
 
 def run_serve(config: MkosiConfig) -> None: