Bug 431697 - It is not possible to select (and thus copy) a previous command if it is log enough on a remote machine
Summary: It is not possible to select (and thus copy) a previous command if it is log ...
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: copy-paste (show other bugs)
Version: 20.12.1
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
: 434681 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-01-16 16:21 UTC by Dmitri Koulikoff
Modified: 2024-02-26 01:37 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Line is wrapping (15.79 KB, image/png)
2021-07-05 14:04 UTC, Dmitri Koulikoff
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitri Koulikoff 2021-01-16 16:21:41 UTC
SUMMARY

The long commands of the history are not being shown in full, only a part of it.


STEPS TO REPRODUCE
0. ssh your-known-host
1. Enter the command `echo something longer than the screen width` and press Enter
2. Press Up to return to this command

OBSERVED RESULT

You see the line that starts with "<" and contains only the last part of your command. If you move the cursor left then after the missing part have appeared, the left side is cut of by ">".

EXPECTED RESULT

Two or more lines containing the whole command

SOFTWARE/OS VERSIONS
Operating System: Slackware 14.5
KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.78.0
Qt Version: 5.15.2
Kernel Version: 5.10.6
OS Type: 64-bit
Processors: 12 × Intel® Core™ i7-9750H CPU @ 2.60GHz
Memory: 31.1 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 630
Comment 1 ninjalj 2021-06-27 18:55:44 UTC
This behavior doesn't come from konsole. It comes from the shell, and can usually be configured via a shell option.

For zsh:
set +o SINGLE_LINE_ZLE

For non-ancient ksh93:
set -o multiline

mksh doesn't seem to have a way to use multiline input. The same is probably true of many older ksh variants.
Comment 2 Dmitri Koulikoff 2021-06-27 21:12:07 UTC
(In reply to ninjalj from comment #1)
> This behavior doesn't come from konsole. It comes from the shell, and can
> usually be configured via a shell option.
> 
> For zsh:
> set +o SINGLE_LINE_ZLE
> 
> For non-ancient ksh93:
> set -o multiline
> 
> mksh doesn't seem to have a way to use multiline input. The same is probably
> true of many older ksh variants.

Thanks, but what setting is for bash?
Comment 3 ninjalj 2021-06-28 13:20:58 UTC
For bash:

bind 'set horizontal-scroll-mode off'

But you should probably first make sure that $TERM is set to something supported on your remote host, since that is probably why bash is defaulting to horizontal-scroll-mode, see: https://unix.stackexchange.com/questions/529377/terminal-long-line-wrapping/529460
Comment 4 Dmitri Koulikoff 2021-07-05 14:04:25 UTC
Created attachment 139871 [details]
Line is wrapping

I have tried both commands but this did not help.
Indeed on the remote machine bash is old and shows the history without the wrapping when I connect from kde4.
It wraps only when I connect from kde5.
Comment 5 ninjalj 2021-07-05 16:02:13 UTC
What's the value of $TERM? What's the output of "infocmp"?

Your remote host probably doesn't have a terminfo description for xterm-256color.  Konsole changed its default value for TERM from xterm to xterm-256color back in late 2016 in https://invent.kde.org/utilities/konsole/-/commit/2671800b084cf89f1a91c6b3fdf93eb3b8078672

TERM should be set to something that the remote host supports, e.g. by launching ssh as follows:

TERM=xterm ssh your-known-host
Comment 6 ninjalj 2021-07-05 16:09:40 UTC
Another option would be to import the terminfo definition from your local host to the remote host, as explained at the above mentioned unix.stackexchange.com post:

infocmp termname | ssh user@host tic -
Comment 7 Dmitri Koulikoff 2021-07-06 06:01:04 UTC
OK, after I have added on the remote machine 
export TERM=xterm
to the /etc/profile all works.

Thanks
Comment 8 ninjalj 2024-02-26 01:37:58 UTC
*** Bug 434681 has been marked as a duplicate of this bug. ***