[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: Chet Ramey
Subject: Re: Full-width characters can result in an unwanted space in filenames
Date: Sat, 4 Mar 2017 14:42:44 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.7.1

On 3/4/17 12:53 AM, Misaki wrote:

> 05 May 2015
> Maybe related bug. If line is offset, such as due to ctrl-C while a command
> is running that doesn't doesn't cause a newline when it exits, then pasting
> a string that contains full-width characters causes the display of the
> first line to be truncated. Doesn't require use of full-width characters.
> Example of how to replicate:
> 1) run ffmpeg -i <video> -f mp4 /dev/null -preset veryfast /dev/null -y |&
> grep hi (the '&' is necessary for ffmpeg's text output as it's standard
> error or whatever)
> 2) press ctrl-C almost immediately
> 3) result: ^C is appended before input prompt, which is shifted right by
> two columns. Can then paste text and see it get truncated. Important if you
> select text to copy it, either with shift-ctrl-C or middle-click paste.

This is not a bug.  Readline assumes that it starts with the cursor in
column 0, so it knows the effect of displaying characters and where to
move the cursor.  If it doesn't start in column 0, it can't discover that,
so its display calculations are going to be wrong.

This has come up before; for example in


``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/

reply via email to

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