Skip to content

Launch xpm in a PTY#650

Open
jonahgraham wants to merge 1 commit intodevelopfrom
launch-xpm-in-pty
Open

Launch xpm in a PTY#650
jonahgraham wants to merge 1 commit intodevelopfrom
launch-xpm-in-pty

Conversation

@jonahgraham
Copy link
Contributor

By launching in a PTY the bash -i won't have its stdin connected to the stdin of Eclipse, meaning it will properly behave and not stop with a SIGTTIN when bash tries to read.

Fixes #626

By launching in a PTY the `bash -i` won't have its stdin connected
to the stdin of Eclipse, meaning it will properly behave and not stop
with a SIGTTIN when bash tries to read.

Fixes #626
@jonahgraham
Copy link
Contributor Author

This seems to be the correct fix. But I am letting this build on CI so that I can have a p2 to install on multiple machines easier to facilitate testing. This works in my linux dev environment when launched from a terminal or from a UI.

This is building on Jenkins now and will be ready as a p2 site in a little while here: https://download.eclipse.org/embed-cdt/builds/launch-xpm-in-pty/

I will progress this again tomorrow.

@ilg-ul Once I have tested this I will let you know so you can test in your environment too.

@ilg-ul
Copy link
Contributor

ilg-ul commented Feb 11, 2026

I checked the new p2 site and it was ok on my RPi5, with Eclipse started both in a terminal or from the file manager.

Can you help me understand your solution?

@ilg-ul
Copy link
Contributor

ilg-ul commented Feb 11, 2026

This works in my linux dev

Just to be sure, did you install node/npm via nvm, as instructed?

@jonahgraham
Copy link
Contributor Author

Just to be sure, did you install node/npm via nvm, as instructed?

Yes.

@jonahgraham
Copy link
Contributor Author

I have tested it by installing https://download.eclipse.org/embed-cdt/builds/launch-xpm-in-pty/p2/ into Eclipse IDE for Embedded C/C++ developers 2026-02 M2. Without the update it hangs (when launched from terminal) and with the update it creates project as expected.

I will now test on a Windows (and maybe a macOS machine if I can borrow one).

Can you help me understand your solution?

ProcessFactory.getFactory().exec() without a PTY will inherit the /dev/tty from the parent process. When launching bash with -i it will try to open /dev/tty. A process cannot access /dev/tty if it is not the foreground process of that terminal, so instead it raises SIGTTIN stopping bash (and hence xpm).

By adding the PTY argument (PTY.isSupported(Mode.TERMINAL) is always true on Linux) the process will be connected to a new PTY and that means /dev/tty will be connected to that PTY instead of the terminal's one.

This allows launching xpm under the bash -i successfully.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants