Open jelly opened 1 month ago
This shouldn't disrupt/stop the current terminal if it is currently running something. My first idea how to do "busy?" detection: https://github.com/cockpit-project/cockpit-files/issues/464#issuecomment-2358778658
My recommendation: to unblock your work (for a few days), replace
spawn: [user.shell "/bin/bash"],
with something like
["/bin/sh", "-ec", "echo $$ > /tmp/terminal-pid; exec " + (user.shell || "/bin/bash")]
and use cockpit.file() to read the pid. This is an utter hack which we can't land, but I think there's enough unrelated work to be done here in the meantime. In the next days I'll see to teach the stream channel about exposing its pid.
@ashley-cui see #21132 for adding a proper API to get the pid.
Page: terminal
Cockpit-files has a feature request to open the terminal page in the current directory of files.
Currently the terminal page will default open the users home directory with a fallback to
/
. We want it to open a provided path for example via uri params, for example:https://cockpit.org/system/terminal#/?path=/home