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

Expand, increase the output of the shell (strings, memory). #2071

Closed
xb3b6 opened this issue May 19, 2021 · 11 comments
Closed

Expand, increase the output of the shell (strings, memory). #2071

xb3b6 opened this issue May 19, 2021 · 11 comments

Comments

@xb3b6
Copy link

xb3b6 commented May 19, 2021

I use some programs that print 5000 lines to the output, but Termux displays only 2500 lines, truncates the beginning of the output.
It is necessary to increase the output of lines, there is enough power everywhere.

@Grimler91
Copy link
Member

Isn't it easier to just tee the output to a file? Scrolling 5000 lines in termux, without the possibility to goto a specific line or search for a specific string, sounds quite miserable.

You could also use tmux and set the number of scrollback lines, as explained here https://stackoverflow.com/a/18777877

@xb3b6
Copy link
Author

xb3b6 commented May 19, 2021

Surprised by this answer.
I'm talking about the standard (frequent operation) information output.
It should be in Termux, tmux is overkill.

@agnostic-apollo
Copy link
Member

The limit is actually 2000. Support can be added for more.

for i in {1..2001}; do echo $i; done

@xb3b6
Copy link
Author

xb3b6 commented Jun 4, 2021

Even standard curl often fails (lacks output). If the shell does not take up a lot of memory, then you need to extend the Termux output as much as possible.

@ghost
Copy link

ghost commented Jun 4, 2021

@xb3b6 Terminal lines are limited since their increase has negative impact on console rendering performance (lags when selecting text or changing font size). For some devices (ROMs) less significant, for some more. It can be increased to 5000 lines, but not more.

tmux has configurable scroll back buffer. You can run commands in it instead.

@agnostic-apollo
Copy link
Member

agnostic-apollo commented Jun 4, 2021

It should be user configurable with termux.properties. Default can stay at 2000 for less ram devices, even though its pretty low. Like QuickEdit app which displays text as an image instead of text, there are limits by android on number of lines and on how many characters can be shown per line. For android 10 with font size 8, line spacing 0sp, limit is 650751 lines. For android 7, max possible limit is like half that. So increasing it reasonably more likely shouldn't cause problems, but will probably depend on user font size, will have to experiment.

@agnostic-apollo
Copy link
Member

Yeah, rendering was also what I was thinking off that may have a negative performance impact. Lot of calls are made for it. But newer devices might be capable enough.

@ghost
Copy link

ghost commented Jun 4, 2021

So increasing it likely shouldn't cause problems, but will probably depend on user font size, will have to experiment.

Increasing scrollback cause lags at least on Lineage OS ROMs. For example, if console filled with thousands lines of output, resizing text become unresponsive and takes effect in 1-2 seconds. Selection works better, though lags are still noticeable.

2000-5000 lines is safe choice. But yes, Termux can have scrollback buffer configurable.

@agnostic-apollo
Copy link
Member

I see, can experiment and see the impact and put a max limit so users can't go beyond.

Who knows if further optimizations can be made to the terminal to increase the overall performance. Lot of code exists now for lot of things which may not be as efficient as it should be. But that's time consuming stuff to look into.

@ghost
Copy link

ghost commented Jun 4, 2021

Terminal rendering performance is actually old issue but since #628 it doesn't take much attention.

@agnostic-apollo
Copy link
Member

Terminal rendering performance is actually old issue but since #628 it doesn't take much attention.

Thanks for this. And yes, that indeed should be looked into at some point. But lot of "dangerous" and unknown code, so should be done with better understanding of it.

With 0b4bbaf, I even went to the max limit of 50000 rows and didn't notice lags on my LG G5 Android 7.0, resizing took a 1-2s but that's expected. Rendering from what I see is only focused for the row currently visible, but buffers and indexing would probably have an impact. Users can do it at their own risk.

AdamMickiewich pushed a commit to VolyaTeam/dzida-app that referenced this issue Aug 8, 2022
This `terminal-transcript-rows` key can be used to adjust the terminal transcript rows. The user can set an integer value between `100` and `50000`. The default value is still `2000`. So adding an entry like `terminal-transcript-rows=10000` to `termux.properties` file will allow users to scroll back ~10000 lines of command output. After updating the value, termux must be restarted. You can also run `termux-reload-settings` command so that termux loads the updated value, but only new sessions will use the updated value, existing sessions will not be affected.

You can test this with the following, where `70` is number of `x` characters per line and `10001` is the number of lines to print.
`x="$(printf 'x%.0s' {1..70})"; for i in {1..10001}; do echo "$i:$x"; done`

Be advised that using large values may have a performance impact depending on your device capabilities, so use at your own risk.

Closes termux#2071
shrihankp pushed a commit to reisxd/termux-app that referenced this issue Oct 20, 2022
This `terminal-transcript-rows` key can be used to adjust the terminal transcript rows. The user can set an integer value between `100` and `50000`. The default value is still `2000`. So adding an entry like `terminal-transcript-rows=10000` to `termux.properties` file will allow users to scroll back ~10000 lines of command output. After updating the value, termux must be restarted. You can also run `termux-reload-settings` command so that termux loads the updated value, but only new sessions will use the updated value, existing sessions will not be affected.

You can test this with the following, where `70` is number of `x` characters per line and `10001` is the number of lines to print.
`x="$(printf 'x%.0s' {1..70})"; for i in {1..10001}; do echo "$i:$x"; done`

Be advised that using large values may have a performance impact depending on your device capabilities, so use at your own risk.

Closes termux#2071
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants