gnome terminal swallows tab characters

Bug #1353354 reported by Andreas Meier
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gnome-terminal (Ubuntu)
New
Undecided
Unassigned

Bug Description

 - use standard gnome terminal 80 x 24
 - add the following chars to a text-file: '>' 12 tabs '<'
 - cat the text file to stdout
 - select the line and paste it back to the text-file
 - 2 tabs are gone, from the original 12 only 10 tabs are visible

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: gnome-terminal 3.6.2-0ubuntu1
ProcVersionSignature: Ubuntu 3.13.0-32.57-generic 3.13.11.4
Uname: Linux 3.13.0-32-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.2
Architecture: amd64
CurrentDesktop: Unity
Date: Wed Aug 6 11:49:34 2014
ExecutablePath: /usr/bin/gnome-terminal
InstallationDate: Installed on 2014-04-17 (110 days ago)
InstallationMedia: Ubuntu 14.04 LTS "Trusty Tahr" - Release amd64 (20140417)
SourcePackage: gnome-terminal
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Andreas Meier (rumpumpel1) wrote :
Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

I'm sure this behavior won't change. TAB is not a regular character, it is a control character, just like let's say escape sequences that move the cursor; copy-pasting doesn't include those either. It's a bonus that gnome-terminal tries to remember when a tab was emitted, most terminal emulators don't do this (you always get spaces when you copy).

Tabs behave really weird when printed near the end of line. We'd need a special variable storing how many tabs were emitted that didn't move the cursor. Actually, we'd need to remember two values: there can be plenty of tabs printed that don't advance the cursor, followed by a letter (printed in the rightmost column, still not advancing the cursor), followed by again many tabs. It's just way too complicated and probably nobody's interested in counting those tabs.

Note that when there's existing content (letters) and you move the cursor back and emit a tab, it doesn't override those characters, it just advances the cursor (that's the intent, a tab is a couple of "move the cursor right" operations rather than a couple of spaces) -- what should copy-pasting do then? It probably just can't be made consistent. Or, the only consistent way of handling them is always converting them to spaces. Consider keeping the tabs a convenience feature that sometimes works.

There are other characters too that are lost when copying and pasting back, e.g. starting combining accents at the beginning of a line, too many combining accents over a character, carriage returns, form feeds, bell, etc...

summary: - gnome terminal swallows tabs
+ gnome terminal swallows tab characters
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.