bug-bash
[Top][All Lists]
Advanced

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

Mac OS X Unicode NFD filesystems and bash completion


From: Guillaume Outters
Subject: Mac OS X Unicode NFD filesystems and bash completion
Date: Tue, 14 Jul 2009 16:59:39 +0200

Configuration Information [Automatically generated, do not change]:
Machine: powerpc
OS: darwin8.11.0
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='powerpc' - DCONF_OSTYPE='darwin8.11.0' -DCONF_MACHTYPE='powerpc-apple- darwin8.11.0' -DCONF_VENDOR='apple' -DLOCALEDIR='/usr/local/ bash-3.2.9/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H - DMACOSX -I. -I. -I./include -I./lib -g -O2 uname output: Darwin asterix.local 8.11.0 Darwin Kernel Version 8.11.0: Wed Oct 10 18:26:00 PDT 2007; root:xnu-792.24.17~1/ RELEASE_PPC Power Macintosh powerpc
Machine Type: powerpc-apple-darwin8.11.0

Bash Version: 3.2
Patch Level: 9
Release Status: release

Description:
        See:
        http://www.mail-archive.com/bug-bash@gnu.org/msg04073.html
        Mac OS X, when listing directories, reports filenames in
        UTF-8 NFD. With an UTF-8 configured input, bash receives
        strings in UTF-8 NFC. Thus its filename completion cannot
        match input strings with filesystem entities when accents
        occur.

Repeat-By:
        cd /tmp
        mkdir Réseau
        ls Ré<tab>
        (Réseau is not proposed as possible completion)

Fix:
        I have come up with a fix that works great on my system,
        using iconv (bundled with Mac OS X, anyway).
        I'm wondering though:
        - Does it work well on "alternate" filesystems (is NFD
          done on OS level, or is it driver dependent?). If someone
          on the list has NTFS-3G-mounted disks or SSHFS, can he/she
          test that at least there is no loss in functionality?
        - Is it Mac OS X specific? I think Darwin has the same VFS
          layer. In this case, is there a more general replacement
          for #ifdef MACOSX?
        - iconv could certainly be detected in a cleaner way as I
          did (forcefully adding it to link libs, and implying it
          from MACOSX preprocessing define).
        Tested with Terminal (UTF-8: works; non-UTF-8: does not
        complete, so not better than before but that's normal) and
        xterm.
        
        I have put the patch here (diff -u format):
        http://ks31107.kimsufi.com/gui/bash-mac-filename-completion.patch
        I have made it for bash 3.2.9, it runs unmodified on a
        3.2.49, and I now use it on a 4.0.24 (patch utility
        detected a 83-lines offset and ran happily)



reply via email to

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