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

Command output is not always displayed #1695

Closed
dfffffff opened this issue Aug 7, 2020 · 9 comments
Closed

Command output is not always displayed #1695

dfffffff opened this issue Aug 7, 2020 · 9 comments

Comments

@dfffffff
Copy link

dfffffff commented Aug 7, 2020

Problem description
Command output is not always displayed when the command is also making the terminal exiting.
Only "[Process completed (code X) - press Enter]" is displayed.

Steps to reproduce
Make a small C program like:

#include <unistd.h>
int main(void)
{
    write(1, "########\n", 9);
    return 123;
}

Execute it with "exec ./smallprog" in a terminal.

Expected behavior
"########" should be always displayed.

Additional information
Some race condition occur, most of the time the output is displayed.
Sounds like sometime the process exit is processed before all buffered output is processed.
Also occur with shell script output.
Happen on stdout or stderr.
The bug is more apparent with Termux:Widget since the terminal is closed after execution, sometime on command error nothing is displayed.

@ghost
Copy link

ghost commented Aug 7, 2020

This is not race condition. Terminal output is being processed only when process is not terminated.

I have made a PR to change that behavior: #1696

@ghost
Copy link

ghost commented Aug 26, 2020

Part of v0.99 release.

@ghost ghost closed this as completed Aug 26, 2020
@dfffffff
Copy link
Author

The problem still arises but less frequently with v0.99.

@pierro78
Copy link

pierro78 commented Mar 30, 2021

still arises with v0.108 in aterm/xfce4-terminal ...
... I have to press "enter" a second time to see the "$" of the shell prompt (I then see 2 "$" actually)

... or sometimes a character I type is not immediately displayed (I have to type another character)

(xterm/xfce4-terminal are working fine in my prooted environment ... mmmm : I did a "git push" and I had to wait for like 5-10 seconds before the Username was asked ... maybe github was just slow ... seems to work anyway as the Username was eventually asked ... )

@RalfWerner
Copy link

@pierro78 Can you give more info about the device and which keyboard you use?
If it is a Samsung device could possibly help enforce-char-based-input=true in ~/termux/termux.properties

@pierro78
Copy link

pierro78 commented Mar 31, 2021

@RalfWerner it s an android 11 xperia 5 2019 ( https://www.reddit.com/r/termux/comments/mfpwry/termux_tripled_the_speed_of_this_12yo_laptop/gsu67dh/?utm_source=reddit&utm_medium=web2x&context=3 )

I am using tigervncviewer or rdp client from my laptop (not from the phone)

shall I fill a different issue in the termux/x11-packages repo as it is related to packages in that repo ?

thanks

PS :
" enforce-char-based-input=true in ~/termux/termux.properties" : I already set that ...

@RalfWerner
Copy link

I have no Xperia device and can not repeat your problem. since a week I have an Android 11 update for my Samsung device. Does your problem occur only when using your laptop (windows X server) or in standalone mode too?

shall I fill a different issue in the termux/x11-packages repo

You should do that only if you have what your problem is triggered

@pierro78
Copy link

I have no Xperia device and can not repeat your problem. since a week I have an Android 11 update for my Samsung device. Does your problem occur only when using your laptop (windows X server) or in standalone mode too?

yes only when I use xterm/xfce4-terminal from the termux/x11-packages repo

the standalone termux shell command line works fine either directly or from ssh client ...

shall I fill a different issue in the termux/x11-packages repo

You should do that only if you have what your problem is triggered

OK I filled a separate issue : termux/termux-packages#10181

thanks

@leap0x7b
Copy link

I get that problem but now i have 2 termux in recent apps

@ghost ghost locked and limited conversation to collaborators Oct 17, 2021
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants