Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the terminal page support opening with a different path #21021

Open
jelly opened this issue Sep 18, 2024 · 3 comments
Open

Make the terminal page support opening with a different path #21021

jelly opened this issue Sep 18, 2024 · 3 comments
Assignees

Comments

@jelly
Copy link
Member

jelly commented Sep 18, 2024

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

@martinpitt
Copy link
Member

This shouldn't disrupt/stop the current terminal if it is currently running something. My first idea how to do "busy?" detection: cockpit-project/cockpit-files#464 (comment)

@ashley-cui ashley-cui self-assigned this Oct 7, 2024
@martinpitt
Copy link
Member

martinpitt commented Oct 17, 2024

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.

martinpitt added a commit to martinpitt/cockpit that referenced this issue Oct 18, 2024
Add the spawned PID to the channel's "ready" message. This will be
useful for cockpit-project#21021
@martinpitt
Copy link
Member

@ashley-cui see #21132 for adding a proper API to get the pid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants