-
-
Notifications
You must be signed in to change notification settings - Fork 394
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
flatpak-spawn --host and tcsetpgrp issue #3697
Comments
From the man page: |
I suppose ioctl TIOCSCTTY should be called from |
Isn't this caused by TIOCSTI being blocked in flatpak? |
No the reason is the according to the man page of
... And ioctl
I do not think there is a way as a user to be able to move the terminal to control another session. And there is no way to move a process to another session. So I do not think it is possible. We would need to create a pty and proxy it, GNU screen style. |
Ok, I thought this is caused by sandbox because I see same message when I call
|
Maybe the correct way to do it, is when calling |
See also: #3285 and flatpak/flatpak-xdg-utils#15 |
I'm not sure that'll work in many cases. What if a new pty is allocated in the sandbox, say by |
Here is a rough example for creating a pty, which I think is the correct approach: https://gist.github.com/akvadrako/24691578799e86c9d8303b854a5cf957 It doesn't handle redirected |
Point to some old code that does allocates a PTY and handles forwarding when using the org.freedesktop.Flatpak.Development.HostCommand interface. I forget at this point how complete it is - it may not handle resizing properly. https://github.com/owtaylor/PurpleEgg/blob/master/common/host-command.c |
I just want to add yet another example of a solution for this, used by https://gitlab.gnome.org/chergert/flatterm/-/blob/master/fp-vte-util.c |
Still encountering this issue. I've been trying to run emacs in a toolbox, and adding a TRAMP method to edit files on the host, through Niche example, I know, but as more and more people try to run their IDE inside flatpak, this will be even more common. |
I've been working on a reimplementation of Indeed the solution was to allocate a pty for the spawned process:
Contributions are welcome! EDIT: The reason why I reimplemented |
Linux distribution and version
GNOME OS master
Flatpak version
Flatpak 1.4.3
Description of the problem
It seems bash has troubles to
tcsetprg
when spawning host bash withflatpak-spawn --host
. This is unexpected since the in source code ofHostCommand
it should set the console right.When using debug mode, we get the error:
Maybe
setsid
andsetpgid
should not be called inchild_setup_func
fromsession-helper/flatpak-session-helper.c
ifdata->set_tty
.Steps to reproduce
The text was updated successfully, but these errors were encountered: