Bug 146146

Summary: when selecting text from konsole, tabs are converted to spaces
Product: [Applications] konsole Reporter: Richard Neill <kde>
Component: generalAssignee: Konsole Developer <konsole-devel>
Status: RESOLVED INTENTIONAL    
Severity: normal CC: daviddlowe.flimm
Priority: NOR    
Version: 1.6.6   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:

Description Richard Neill 2007-05-30 14:14:53 UTC
Version:            (using KDE KDE 3.5.6)
Installed from:    Ubuntu Packages

When copying text from konsole, tabs get converted to spaces. This is a bit of a nuisance when
editing, for example, makefiles. This applies when directly using the shell, it also applies when running a console editor such as nano.

To reproduce:   
 1)  echo -e "This\tcontains\ttabs"
 2)  select text
 3)  paste text
 4)  result: "This    contains        tabs"
 
[This might be intentional; if so, can we have an option to change it?]

Thanks very much - Richard
Comment 1 Robert Knight 2007-06-02 17:21:28 UTC
To the best of my knowledge, this is not fixable within Konsole, as it happens lower down the software stack.  I'd need to verify that though.

You can observe the same effects in xterm and gnome terminal.
Comment 2 Will Stephenson 2007-11-22 21:35:34 UTC
Sounds like a CANTFIX but we don't have that
Comment 3 David D Lowe 2020-10-09 18:17:53 UTC
If your script produces a tab-separated CSV, copying and pasting into a spreadsheet application like LibreOffice Calc or Google Sheets prints it into a table as expected in most GUI terminals like GNOME terminal.

However, Konsole doesn't do this. Konsole converts hard tabs to spaces, which gives unexpected and unwanted results when pasting the text into spreadsheet applications.

Can we reopen this bug?
Comment 4 Christoph Feck 2020-11-01 13:51:17 UTC
David, did you check if it works with xterm or gnome terminal? I quickly checked only xterm, and there an echo -e "X\tY" shows output with individual spaces selectable, instead of only being able to select the single Tab character.
Comment 5 David D Lowe 2020-11-02 09:01:43 UTC
GNOME Terminal works as expected (hard tabs stay hard tabs), but xterm seems to convert hard tabs to spaces.