Bug 312787 - Tab character is not printed in last column of output
Summary: Tab character is not printed in last column of output
Status: RESOLVED NOT A BUG
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: 2.8.5
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-07 00:57 UTC by adeiross
Modified: 2021-03-10 02:14 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description adeiross 2013-01-07 00:57:28 UTC
A tab character is not printed between two non-whitespace characters when the tab occurs in the last column of the output.

In the example below, when I run bash in a Konsole window of width 80 and echo a string composed of 79 "a" characters, a tab character, and 3 "b" characters, columns 79-80 of the output contain the string "ab", not separated by any whitespace.  The output misleadingly gives no indication that there is a tab character present in the string.

Reproducible: Always

Steps to Reproduce:
1. Launch a konsole session running bash with a width of 80.
2. Run the command below:
$ echo -e aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\tbbb
Actual Results:  
Konsole does not print whitespace between "a" and "b":

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab
bb

Expected Results:  
Konsole should separate the "a" and "b" with whitespace:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 
bbb

It occurs to me that this behavior might be attributable to bash as opposed to Konsole.  (The bash version for my Linux VM is 4.2.24.)  I see the same behavior in xterm-271.  On my Mac running bash 3.2.48, I also see the same behavior in Terminal.app, but not in iTerm.app -- iTerm.app alone gives the output I label above as expected.  So perhaps this issue is default bash behavior, which has been "corrected" only by iTerm.app?

My Linux machine is a VirtualBox VM (hosted by my Mac):
$ uname -a
Linux xubuntu 3.2.0-35-generic #55-Ubuntu SMP Wed Dec 5 17:42:16 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
$ konsole --version
Qt: 4.8.1
KDE Development Platform: 4.8.5 (4.8.5)
Konsole: 2.8.5

Any insight you can offer would be appreciated.
Comment 1 adeiross 2013-01-07 01:01:03 UTC
Sorry, the example command to reproduce the issue should have quotes:

$ echo -e 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\tbbb'
Comment 2 ninjalj 2021-03-10 02:14:22 UTC
Konsole and xterm behavior is correct.

See:
https://vt100.net/docs/vt102-ug/chapter5.html#T5-2
"HT [...] Moves cursor to next tab stop, or to right margin if there are no more tab stops."

and
https://vt100.net/docs/vt102-ug/chapter5.html#S5.5.2.8
"NOTE: Regardless of the auto wrap SET-UP feature selection, the tab character never moves the cursor to the next line."