3

Using a normal bash prompt echo -e 'hello\tworld' produces a real tab. However the same command run within GNU screen puts spaces between the two words.

I have tested this on Ubuntu 10.04 with Screen version 4.00.03jw4 (FAU) 2-May-06 and RHEL 5.5 with Screen version 4.00.03 (FAU) 23-Oct-06

Is there a way to have screen output tab characters instead of converting them to spaces?

2 Answers 2

1

No, there is no way, short of writing code. Have a look at the man page under "BUGS:"

  • Screen does not make use of hardware tabs.

Hardware, in my case, is the software "gnome-terminal."

1
  • 1
    I also get the same behavior in tmux. I wonder if this is a difficult problem to solve.
    – phylae
    Jun 9, 2011 at 7:19
0

This simple experiment, inside GNU Screen, shows me that "\t" is outputting a TAB character (NOTE: You were missing an "-e" flag to your echo command):

skx@birthday:~$ echo -e "Hello\tWorld" | od -c
0000000   H   e   l   l   o  \t   W   o   r   l   d  \n
0000014

Now I repeat that command and save the output to a file, verifying that there is a TAB character still present:

skx@birthday:~$ echo -e "Hello\tWorld" > x
skx@birthday:~$ od -c < x
0000000   H   e   l   l   o  \t   W   o   r   l   d  \n
0000014

BUT if I cat that file, and copy and paste, via my mouse, into emacs the TAB is lost. So it seems like the parent gnome-terminal is doing something odd, or the tab is converted when pasted into my new window. Either way I suspect GNU Screen isn't to blame.

1
  • It could be something to do with both gnome-terminal (I tried versions 2.30.2 and 3.0.1) and screen together, it can't be just gnome-terminal because it "works" when I don't use screen. Also when I use screen's copy mode (CRTL+A ESC), highlight the output (arrow keys, then SPACE, then arrow keys), and write out the output to the screen's temp file buffer, it sees it as spaces.
    – phylae
    Jun 9, 2011 at 7:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .