termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
13.15k stars 3.02k forks source link

[Bug]: aterm on Pixel 8 closes immediately using termux-x11 #21178

Closed natebragg closed 1 month ago

natebragg commented 1 month ago

Problem description

When running:

  u0_a109@localhost:~$ termux-x11 -xstartup aterm

The aterm white rectangular window border appears in the X11 session, and then disappears immediately. This does not occur on another device that I tested.

When running using strace, the following line appears:

read(4, "no sessions\r\n", 1024)        = 13

This does not appear on the other device. Give that it's a read, I'm not sure what is happening, but aterm exits almost immediately after this line is outputted.

What steps will reproduce the bug?

Using a pixel 8 as in the system information below, open a termux shell and the termux-x11 app, and put them in split-screen mode. Then run:

termux-x11 -xstartup 'sleep 1000' && strace aterm

You will see the white border appear, then disappear a fraction of a second later.

What is the expected behavior?

The aterm window should remain on the screen, and the shell should start.

System information

Termux Variables:
TERMUX_APK_RELEASE=F_DROID
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=26404
TERMUX_IS_DEBUGGABLE_BUILD=0
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.1
TERMUX__USER_ID=0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://mirror.mwt.me/termux/main stable main
# root-repo (sources.list.d/root.list)
deb https://mirror.mwt.me/termux/root root stable
# x11-repo (sources.list.d/x11.list)
deb https://mirror.mwt.me/termux/x11 x11 main
Updatable packages:
apt/stable 2.8.1-1 aarch64 [upgradable from: 2.8.1]
command-not-found/stable 2.4.0-38 aarch64 [upgradable from: 2.4.0-37]
libbsd/stable 0.11.7-1 aarch64 [upgradable from: 0.11.7]
librsvg/stable 2.58.3 aarch64 [upgradable from: 2.58.2]
libunbound/stable 1.21.0 aarch64 [upgradable from: 1.20.0-1]
nano/stable 8.1 aarch64 [upgradable from: 8.0]
racket/stable 8.14 aarch64 [upgradable from: 8.13]
unbound/stable 1.21.0 aarch64 [upgradable from: 1.20.0-1]
termux-tools version:
1.43.3
Android version:
14
Kernel build information:
Linux localhost 5.15.137-android14-11-gb572b1fac135-ab11919372 #1 SMP PREEMPT Mon Jun 3 16:35:10 UTC 2024 aarch64 Android
Device manufacturer:
Google
Device model:
Pixel 8
LD Variables:
LD_LIBRARY_PATH=/opt/gurobi1101/armlinux64/lib
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
Installed termux plugins:
com.termux.x11 versionCode:15
twaik commented 1 month ago

aterm will not get DISPLAY in the case if it is a separate command outside of -xstartup argument. You should export it manually.

natebragg commented 1 month ago

Noted. In the meantime I actually realized this was user error --- it was crashing during .bashrc due to a missing setting in .tmux.conf. I was not getting an error, however. When I reproduce this error manually, #? = 1, but when termux-x11 stops it prints 12345 exited, status=0, which implied to me that aterm was actually exiting successfully without an error. Is this "swallowing" the error expected behavior? Why even print a status code if so?

twaik commented 1 month ago

It prints exit status code of aterm, not of a shell aterm starts.

natebragg commented 1 month ago

Ah, that makes sense! Thanks for your explanation. Well, my mistake aside, I'll have to blame aterm then since it's sort of weird for them to swallow that error. You'd think the shell crashing would cause aterm to exit with an error.