[Top][All Lists]

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

Re: Full-width characters can result in an unwanted space in filenames

From: L A Walsh
Subject: Re: Full-width characters can result in an unwanted space in filenames
Date: Sun, 05 Mar 2017 09:39:03 -0800
User-agent: Thunderbird

Chet Ramey wrote:
On 3/4/17 12:53 AM, Misaki wrote
Full-width character, followed by at least one full word with a space after it.

Example: あa a
With trailing space.

This is a display artifact. If there is one physical space left on the
screen line, but the character to be printed occupies more than one space,
bash needs to wrap before the end of the screen line, and it needs to
keep track of that.
I can reproduce this in 4.4.5:

Also, when you quoted her text, your quote didn't
have a space after the 2nd 'a' above.  Her original did.

This is sort of an aside, but related:
Something in your text display+copy+insert isn't accurate (I have a feeling this is related how tabs are copied & inserted in your environment as well). I.e. if I copy + insert(paste) into bash, the presence of tabs or spaces from the source is duplicated when I paste, so from most source files (i.e. shell
 scripts, etc), when tabs are used to indent, they end up being pasted as
 literal tabs.  This activates auto-complete which swallows a character.
It's also the case that tabs that are input don't get echoed back -- instead
 bash echo's out some number of spaces which cat be very wrong on
 linux and vt100 compatible terminals (variable tabstops).

But try this:

echo 'あa a '|wc -m

There should only be 5 characters.

If I cut/paste her text (in quotes) directly into 'wc -m' (so it
doesn't go through bash, but is taken directly from 'wc' on its
stdin), then I get '7' (2 extra chars for the quotes):

 wc -m
'あa a '7
       ^^ pressed Ctl-D twice to not end line w/another char (like LF).

Maybe that examples allows you to duplicate the problem?

reply via email to

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