! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Missing characters in output
Status:
RESOLVED: INVALID
Product:
Xfce4-terminal
Component:
General

Comments

Description vassil88 2018-09-17 10:14:21 CEST
Set terminal dimensions to 50x39 and execute `lsblk`; for me output is "/media/vassil/Debian testin" instead of "/media/vassil/Debian testing amd64 1"; output from `pwd`, `uname -a` wrap correctly

uname -a: Linux debian 4.9.0-8-amd64 #1 SMP Debian 4.9.110-3+deb9u4 (2018-08-21) x86_64 GNU/Linux
Comment 1 Igor editbugs 2018-09-17 14:39:32 CEST
Hi,

I don't have such a long mount point to check here, unfortunately.
Can you try it with `xterm` - will it wrap the string?
Comment 2 vassil88 2018-09-17 18:43:18 CEST
`xterm` output wraps correctly;
I've only observed the strange behavior with `lsblk`
Comment 3 Egmont Koblinger 2018-09-17 18:43:53 CEST
lsblk check the terminal's width and crops its output accordingly. Presumably it prints "/media/vassil/Debian testin" in your case.
Comment 4 Egmont Koblinger 2018-09-17 18:44:18 CEST
checks*
Comment 5 Igor editbugs 2018-09-17 18:47:16 CEST
Hi Egmont, are you saying this kind of behavior is expected from `lsblk`?
Comment 6 Egmont Koblinger 2018-09-17 18:53:06 CEST
Yup.

I mean, I haven't strace'd it to make 100% sure that it does not even emit that "g amd64 1", but when ran at different widths, it aligns its columns differently. So I'm pretty sure that's what's going on here.

I'm not familiar with lsblk, this is just the behavior I'm experiencing now.

It has a cmdline option -p, --paths "Print full device paths", sounds like maybe the one OP is looking for. I cannot test it now.
Comment 7 Igor editbugs 2018-09-17 19:03:21 CEST
The '-p' option prints full device path (such as "/dev/sda") which is not what the OP is looking for.
The '-r' option, however, prints the entire string for me (replacing spaces with "\x20").

Indeed, this seems to be lsblk's behavior and not something that the terminal is responsible for. Closing the bug.
Comment 8 Egmont Koblinger 2018-09-17 19:15:42 CEST
-p/-r: indeed, thanks.

Unfortunately lsblk doesn't allow its believed terminal width to be overridden using $COLUMNS. However, another possible trick is "lsblk | cat". Then its stdout is not connected to a terminal, hence doesn't attempt to find out the width but just prints every line without truncating.
Comment 9 vassil88 2018-09-17 19:23:50 CEST
`lsblk -p` missing characters in output
`lsblk -r` wraps correctly

`findmnt` missing characters in output
`findmnt -r` wraps correctly
Comment 10 vassil88 2018-09-17 19:25:46 CEST
`lsblk | cat` another solution. Thanks.
Comment 11 Egmont Koblinger 2018-09-17 19:27:32 CEST
findmnt also has a -u, --notruncate option. Sounds like what you need, not sure. You might want to ask the authors of these utilities to provide a convenient, same option across these related apps.
Comment 12 Igor editbugs 2018-09-17 19:29:11 CEST
Yeah, I'd say truncating the output by default is a very questionable design...

Bug #14703

Reported by:
vassil88
Reported on: 2018-09-17
Last modified on: 2018-09-17

People

CC List:
1 user

Version

Attachments

Additional information