bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bash doesn't display user-typed characters; can interfere with COPY/


From: Chris Elvidge
Subject: Re: bash doesn't display user-typed characters; can interfere with COPY/PASTE
Date: Tue, 8 Dec 2020 09:53:54 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 Lightning/5.4

On 08/12/2020 01:02 am, L A Walsh wrote:
If I type in (<TAB> + <ENTER> are keypresses)

if [[ '<TAB>' == $'\t' ]]; then echo ok; else echo notok; fi <ENTER>

bash displays:

if [[ ' ' == $'\t' ]]; then echo ok; else echo notok; fi
ok


if I now copy the 'if' line and paste it

if [[ ' ' == $'\t' ]]; then echo ok; else echo notok; fi
notok

if I take the same line from an editor like gvim, it works.
If the test line is in a file, and I use 'cat file' and copy/past the
resulting line, it works.

It is only when bash is displaying the line that it doesn't work.

The problem is that bash isn't displaying a 'tab' character where
one was typed.  With many (most?) terminal windows these days, especially
Unicode-enabled ones, the terminal has to read what is on the screen to
be able to read the binary code of whatever is displayed on the screen,
Otherwise, it wouldn't be able to read typed unicode.

Can this be fixed -- maybe with an option in 'shopt', for those who might
be using a non-expanding terminal, but anyone using an xterm/linux compatible
terminal should get the expansions from their terminal.
Where this can be even more annoying is if your terminal's response to a tab
is different than that used on old-hardware terminals.

Thanks,
-l









Try Ctrl-V before hitting <TAB>.

--
Chris Elvidge
England




reply via email to

[Prev in Thread] Current Thread [Next in Thread]