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
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?
`xterm` output wraps correctly; I've only observed the strange behavior with `lsblk`
lsblk check the terminal's width and crops its output accordingly. Presumably it prints "/media/vassil/Debian testin" in your case.
checks*
Hi Egmont, are you saying this kind of behavior is expected from `lsblk`?
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.
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.
-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.
`lsblk -p` missing characters in output `lsblk -r` wraps correctly `findmnt` missing characters in output `findmnt -r` wraps correctly
`lsblk | cat` another solution. Thanks.
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.
Yeah, I'd say truncating the output by default is a very questionable design...