View previous topic :: View next topic |
Author |
Message |
LIsLinuxIsSogood Veteran
Joined: 13 Feb 2016 Posts: 1179
|
Posted: Sun Oct 15, 2017 11:36 pm Post subject: Help with resizing window of terminal emulator [SOLVED] |
|
|
Why does my terminal emulator not "scrub" the screen for a refresh of the lines of text buffer already there? What I want is for it to work exactly the way that xterm does which does that.
I am not using a window manager, other than very basic window manager that really doesn't have much in the way of settings. I guess this question could be either about 1 of 2 things, the way of controlling X11 using the .Xresources file and .xinitrc or else possibly a more efficient solution that could require digging around in the source code for the terminal emulator rxvt-unicode.
Last edited by LIsLinuxIsSogood on Fri Oct 20, 2017 10:49 am; edited 1 time in total |
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9677 Location: almost Mile High in the USA
|
Posted: Mon Oct 16, 2017 1:29 am Post subject: |
|
|
No, the terminal is emulating a dumb terminal like back in the olden days - the screen does not store any state, so if you resize it, it will not redraw it...
... however, it can optionally send a signal SIGWINCH that tells the application to go ahead and redraw, if it is running directly in the window. I'm not sure if ssh will pass SIGWINCH, it might...
All in all, the program running in the terminal is responsible to store all state on the screen. _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
LIsLinuxIsSogood Veteran
Joined: 13 Feb 2016 Posts: 1179
|
Posted: Wed Oct 18, 2017 7:15 am Post subject: |
|
|
How would you use a signal to a running process in another terminal? I am not familiar with that type of linux programming, but maybe a link to some activity based learning would be helpful. Thanks for passing along the tip, and I am going to try and make use of it, but if it requires a lot of programming I may not be ready for that. |
|
Back to top |
|
|
cboldt Veteran
Joined: 24 Aug 2005 Posts: 1046
|
Posted: Wed Oct 18, 2017 12:03 pm Post subject: |
|
|
Might be overkill (or not at all what you are seeking), but running a program or just a shell under `screen` facilitates resizing.
^A-f (Ctl-A, followed by "f") causes the display to "fit" the resized window. That sequence can be sent through ssh.
I use `screen` to keep a few programs running on a server, then attach to those running sessions from remote computer(s). It is this context where the "fit" command can be sent. In other words, I am "in" the same terminal. It is also possible to send or "stuff" key-sequences to a running screen session, even across ssh. This requires knowing the name of the screen session. |
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9677 Location: almost Mile High in the USA
|
Posted: Wed Oct 18, 2017 1:50 pm Post subject: |
|
|
You can try
$ kill -28 pid-of-program
though of course applications that understand the signal would respond.
VTE derived terminals does something strange as they even try to redraw command line programs... _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
LIsLinuxIsSogood Veteran
Joined: 13 Feb 2016 Posts: 1179
|
Posted: Fri Oct 20, 2017 10:30 am Post subject: |
|
|
I'm still trying to figure this out, but it isn't a huge priority, something else I found that discussed some other possible routes, makes it look like I may not be able to send those signals to the child processes that are running the shell. Anyway, the main reason I use the shell rxvt-unicode is because it has a daemon included that makes spawning new terminals uber fast, which I like a lot.
So if I have to sacrifice the appearance of text in the terminal, I already realized that there are some features lacking there with it anyway. I will consider marking this solved but only after I've attempted the solution of screen that was recommended. Thank you both! |
|
Back to top |
|
|
LIsLinuxIsSogood Veteran
Joined: 13 Feb 2016 Posts: 1179
|
Posted: Fri Oct 20, 2017 10:49 am Post subject: |
|
|
Just attempted it, and for the purpose of what I want (redrawing of man page, using man command) I don't think it is going to work. There's some other interesting posts, but the man page for man is leading me to believe that what I really want is to try a different pager for the man program. Thanks guys, I will mark it as solved based on having realized that problem is not going to be resolved without some changes to the application I'm using. |
|
Back to top |
|
|
cboldt Veteran
Joined: 24 Aug 2005 Posts: 1046
|
Posted: Fri Oct 20, 2017 11:28 am Post subject: |
|
|
I just tried this too, using the output of `man man` as the text. Screen's "fit" command doesn't redraw the output under terminal `st` or terminal `urxvt`. Also not doing a redraw job is the ^L (Ctrl-L) command.
If I do a similar redraw experiment with an ncurses program (I'm using `make menuconfig` from the kernel sources), the screen is redrawn automatically on terminal resize (`make menuconfig` demands at least 80 character width), without resort to a "screen" program and its "fit" command, or ^L.
I also tried screen's "fit" command against terminal outlput, `ls` I'd say that screen's "fit" command isn;t useful for your purpose. I use it from time to time because I am viewing the same output in two different terminal at the same time. In that context, I can cause new output to "fit" the screen terminal I am currently viewing in, and the appearance in the other terminal will be "wrong." |
|
Back to top |
|
|
|