-
I'm just curious I'm working on a plugin that I want to be able to embed a terminal connected to a host so I can both work in the plugin as well as have terminal access to the host. I know you can go directly to the host and use the terminal there and such but eventually, I'll be doing multi-host interaction and it would be great to be able to embed a terminal for each host into my application to see/interact with both at the same time. Is this something that is possible? Currently, I'm just trying to make a custom react component to emulate a terminal. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
It definitely is possible and should not be even that difficult. You can take a look into https://github.com/cockpit-project/cockpit/blob/main/pkg/systemd/terminal.jsx and https://github.com/cockpit-project/cockpit/blob/main/pkg/lib/cockpit-components-terminal.jsx how we create our terminal. What we use is just xterm.js (or even just patternfly console) as user facing interface and cockpit.channel for communication with the host. You can specify |
Beta Was this translation helpful? Give feedback.
It definitely is possible and should not be even that difficult. You can take a look into https://github.com/cockpit-project/cockpit/blob/main/pkg/systemd/terminal.jsx and https://github.com/cockpit-project/cockpit/blob/main/pkg/lib/cockpit-components-terminal.jsx how we create our terminal.
What we use is just xterm.js (or even just patternfly console) as user facing interface and cockpit.channel for communication with the host. You can specify
host
option to connect to different hosts.