Xfce Forum

Sub domains
 

You are not logged in.

#1 2022-06-22 17:20:17

wrh1728
Member
Registered: 2020-12-15
Posts: 38

xfce4-terminal scrolling back problem

This involves another application as invoked when launching xfce4-terminal, but it seems to affect the behavior of xfce4-terminal in a way that it does not affect other terminal emulators - in this light, maybe somebody in this forum can provide useful feedback.

I am using xfce4-terminal 0.8.10 under Xfce 4.16. I have set my xfce4-terminal preferences so that each new instance will have a scrollbar on the right, and about 1000 lines will be kept at any time. This works as expected when I simply invoke xfce4-terminal.

I also use xfce4-terminal when accessing remote servers. Since you never know when the connection may get interrupted, I combine this with the Linux autossh and screen tools so that I can recover my shell in such cases. What I have noticed is that, when I do that, I lose the scrolling capability in the resulting xfce4-terminal instance. It turns out to be the case that autossh has nothing to do with it; it is just screen, as the following simple invocation illustrates:

      xfce4-terminal -e "screen"

The scrollbar is still present in the resulting xfce4-terminal instance, but I can't scroll at all. In an instance of xfce4-terminal invoked without any arguments, the scrollbar shrinks when the output to the terminal exceeds its size, and one can use the Shift-Page Up and Shitf-Page Down keys or the wheel in the mouse to scroll up and down. When launched with screen as above, Shift-Page Up and Shift-Page Down are just echoed as 2- in the command line, and the wheel just moves up and down command line history. Output lines don't seem to be saved at all.

The thing is, when I do this with other terminal emulators (e.g. xterm) this kind of behavior is not observed - I can scroll up and down no matter whether the emulator is launched by itself, or executing screen as above.

It seems to be something to do with the way in which xfce4-terminal specifically interacts with screen - but I have no clue as to what it may be. Ideas, anyone? In particular, can xfce4-terminal be configured to get around this issue, so scrolling still works when launched with screen?

Offline

#2 2022-06-22 17:59:07

KBar
Moderator
Registered: 2021-11-05
Posts: 689

Re: xfce4-terminal scrolling back problem

I looks like scrolling doesn't work on any terminal emulator running a screen session. It has different modes: you need to enter copy mode to enable scrolling. I suggest reading through this. It has some interesting answers and tips.


Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please! tongue

Offline

#3 2022-06-22 18:02:07

wrh1728
Member
Registered: 2020-12-15
Posts: 38

Re: xfce4-terminal scrolling back problem

Thanks. However, it does work with xterm, as I pointed out.

Offline

#4 2022-06-22 19:30:42

KBar
Moderator
Registered: 2021-11-05
Posts: 689

Re: xfce4-terminal scrolling back problem

Probably because it was set up in one of the system-wide configuration files, or maybe in ~/.screenrc.

Anyway, try adding this to ~/.screenrc:

termcapinfo xterm* ti@:te@

You can replace xterm* with the specific type on your system. To check that:

printenv TERM

Source.


Remember to edit the subject of your topic to include the [SOLVED] tag once you're satisfied with the answers or have found a solution (in which case, don't forget to share it as well), so that other members of the community can quickly refer to it and save their time. Pretty please! tongue

Offline

#5 2022-06-22 19:58:39

wrh1728
Member
Registered: 2020-12-15
Posts: 38

Re: xfce4-terminal scrolling back problem

That did the trick - thanks so much. As it happens, the entry that I had in my ~/.screenrc file was

    termcapinfo xterm ti@:te@

Since my code gets xfce4-terminal to launch screen to set the TERM environment variable equal to xterm-256color, on adding a trailing * to xterm makes the resulting xfce4-terminal behave just as if it had been launched without any options - which is exactly what I wanted all along.

Thanks also for the link you posted in a previous response, for it supplied information that I was not aware of and that can potentially be useful.

Offline

#6 2022-06-22 22:57:58

wrh1728
Member
Registered: 2020-12-15
Posts: 38

Re: xfce4-terminal scrolling back problem

There is a twist to this whole thing so I am going add a few notes here, in case this information may be of use to someone.

With the settings discussed in this thread, the terminal emulator obtained with

     xfce4-terminal -e "screen -T xterm-256color"

allows one to do screen scrolling in the usual way - for all practical purposes, it seems to work exactly as it would when invoking xfce4-terminal with no arguments.

Now I started this thread because I came across the issue described when connecting to remote hosts using a combination of autossh and screen through xfce4-terminal. The command that I was using is the following:

     xfce4-terminal -e "autossh -M 0 -t <remote-host> \"screen -T xterm-256color\""

Unfortunately, with this screen scrolling does not work. I did a search online, and came across the following recipe that does work:

     xfce4-terminal -e "screen_connect <remote-host>"

where screen_connect is a shell script with the following contents:

     autossh -M 0 -- -o "ServerAliveInterval 5" -o "ServerAliveCountMax 1" \
             -t $1 $'bash -c \'tmpScreenConfig=$(mktemp); \
                   echo "deflogin on" >> $tmpScreenConfig; \
                   echo "termcapinfo xterm* ti@:te" >> $tmpScreenConfig; \
                   echo "hardstatus string \"[%t%] %h\"" >> $tmpScreenConfig; \
                   echo "defscrollback 8192" >> $tmpScreenConfig; \
                   echo "altscreen on" >> $tmpScreenConfig; \
                   echo "maptimeout 0" >> $tmpScreenConfig; \
                   echo "startup_message off" >> $tmpScreenConfig; \
                   echo "msgwait 0" >> $tmpScreenConfig; \
                   exec screen -T xterm-256color -c $tmpScreenConfig\''

I do not understand why one has to use a roundabout approach like this, but it does work.

Offline

#7 2022-06-23 01:17:56

Skaperen
Member
From: right by Jesus, our Saviour
Registered: 2013-06-15
Posts: 812

Re: xfce4-terminal scrolling back problem

it looks like this method runs screen on the local host.  i have been connecting to remote hosts (all Linux) for years by running screen on the remote host.  if the remote host stays up and the failure is network connectivity only, reconnecting, also doing remote screen, gets my remote session back.  i have never had a scrolling issue.  i make these remote connections using a bash script that wraps the ssh command and adds to the remote expression.

i originally named it ssh+ but later changed it to just ssh since i use it for just about everything.  i am not launching a new xfce4-terminal or any kind of GUI terminal emulator to do this.  i could do this on the Linux text console sessions, too.

the syntax i added is a "+" after the user name is followed by the remote session name.  if a new one is created, that becomes its screen-based session name.  if a session with that name already exists, that is the session that is reconnected.  a "+" after the remote host name or IP address is followed by an alternate ssh port number.  this was done to make it easier to specify through rsync.

Offline

Board footer

Powered by FluxBB