Bug 771198

Summary: Tab completion should work with characters instead of bytes
Product: Red Hat Enterprise Linux 6 Reporter: Petr Šabata <psabata>
Component: mkshAssignee: Michal Hlavinka <mhlavink>
Status: CLOSED ERRATA QA Contact: Jan Kepler <jkejda>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.2CC: jkejda, mhlavink, mkyral, mnavrati, ovasik, redhat-bugzilla, tg
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: mksh-39-9.el6 Doc Type: Bug Fix
Doc Text:
Previously, the mksh shell worked with bytes instead of characters when looking for the common part of a file name. As a consequence, the common part of the file name could contain only the beginning part of the border character, and only a part of the character was printed. With this update, mksh works with whole characters when looking for the longest common prefix, and tab completion prints the correct common part as expected.
Story Points: ---
Clone Of: 745702 Environment:
Last Closed: 2014-05-22 13:16:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 745702    
Bug Blocks:    

Description Petr Šabata 2012-01-02 12:24:20 UTC
+++ This bug was initially created as a clone of Bug #745702 +++

Description of problem:
Tab completion in mksh seems to work with bytes, not characters.  This results in a poor user experience when working with filenames in multibyte encodings.

Version-Release number of selected component (if applicable):
mksh-40b-2.fc15.x86_64

How reproducible:
Always

Steps to Reproduce:
1. mkdir t && touch t/십일 t/십이
2. Type 'ls t/' and hit <TAB>
  
Actual results:
t/십�

Expected results:
t/십

Additional info:
This should be reproducible with anything beyond ASCII range with UTF-8.

--- Additional comment from redhat-bugzilla on 2011-12-25 23:59:30 CET ---

Thorsten, this sounds like something for you as upstream.

--- Additional comment from tg on 2011-12-26 21:02:09 CET ---

Agreed (thanks for the testcase and bringing it to my attention),
especially as the line editor behaves funnily afterwards… will fix.

--- Additional comment from tg on 2011-12-30 00:40:31 CET ---

Created attachment 550003 [details]
fix from mksh CVS

fixed upstream, thanks for the report

--- Additional comment from psabata on 2012-01-02 10:53:53 CET ---

Works like a charm, thank you for the fix!

--- Additional comment from redhat-bugzilla on 2012-01-02 10:57:17 CET ---

Petr: Can you try to backport this patch into RHEL 6?

Thorsten: How far is the next mksh release? Shall I wait?

--- Additional comment from tg on 2012-01-02 11:25:32 CET ---

Robert: probably in 2-3 weeks, depending on the feedback I get for what’s
currently in the CVS branch R40-stable which I uploaded to Debian unstable.
You might want to package that (I just used R40d and a diff between that
and the current head of the R40-stable branch) in the meantime if you can’t
live without this fix. Be aware it contains less tested changes to the per-
sistent history code (which is why I’m reluctant to release now).

See also the recent mails on miros-mksh@ (via GMane)

--- Additional comment from psabata on 2012-01-02 13:23:01 CET ---

(In reply to comment #5)
> Petr: Can you try to backport this patch into RHEL 6?

This is a task for its RHEL maintainer, Michal Hlavinka (CC'd already).
I'll clone this bug for RHEL6.

Comment 1 Petr Šabata 2012-01-02 12:25:28 UTC
A patch is available; see bug #745702.

Comment 12 errata-xmlrpc 2014-05-22 13:16:45 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-0533.html