Opened 10 years ago

Closed 8 years ago

#47622 closed defect (worksforme)

bash @4.3.33_0: escapes non-latin symbols when completing paths with spaces

Reported by: xeron (Ivan Larionov) Owned by: raimue (Rainer Müller)
Priority: Normal Milestone:
Component: ports Version: 2.3.3
Keywords: haspatch Cc:
Port: bash

Description

Steps to reproduce:

  • Create a file or dir with at least one space in name and with some non-latin symbols (good example is "абвгдеёжзиклмнопрстуфчцчшщъыьэюя 1" because it includes whole Russian alphabet)
  • Type "ls аб" and press <TAB>

Expected behavior: bash autocompletes a path and escapes only spaces

Actual behavior: bash autocompletes a path but escapes most of the symbols

I can't reproduce this using Linux and bash 4.2.37(1)-release and OS X bundled bash 3.2.57(1)-release.

~$ touch Тест\ 1
~$ mkdir Тест\ 2
~$ ls Тест<TAB><TAB>
~$ ls Те\с\т\
Тест 1  Тест 2/
~$ ls Те\с\т\ 1
Тест 1
~$ echo $BASH_VERSION
4.3.33(1)-release
~$ /bin/bash
~$ ls Тест<TAB>
~$ ls Тест\ 1
Тест 1
~$ echo $BASH_VERSION
3.2.57(1)-release
~$ touch "стр 1 стр 2 стр 3 абвгдеёжзиклмнопрстуфчцчшщъыьэюя"
~$ ls стр<TAB>
~$ ls \с\т\р\ 1\ \с\т\р\ 2\ \с\т\р\ 3\ а?\?вгде\?\?жзиклмноп\р\с\т\у\ф\ч\ц\ч\ш\щ\ъ\ы\ь\э\ю\я
стр 1 стр 2 стр 3 абвгдеёжзиклмнопрстуфчцчшщъыьэюя
~$ locale
LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL=

Linux:

~# touch "стр 1 стр 2 стр 3 абвгдеёжзиклмнопрстуфчцчшщъыьэюя"
~# ls стр<TAB>
~# ls стр\ 1\ стр\ 2\ стр\ 3\ абвгдеёжзиклмнопрстуфчцчшщъыьэюя
стр 1 стр 2 стр 3 абвгдеёжзиклмнопрстуфчцчшщъыьэюя
~# echo $BASH_VERSION
4.2.37(1)-release

Attachments (1)

bash.diff (965 bytes) - added by xeron (Ivan Larionov) 10 years ago.

Download all attachments as: .zip

Change History (10)

Changed 10 years ago by xeron (Ivan Larionov)

Attachment: bash.diff added

comment:1 Changed 10 years ago by xeron (Ivan Larionov)

This patch fixes this issue. Looks like the reason is readline.

comment:2 Changed 10 years ago by larryv (Lawrence Velázquez)

Cc: raimue@… removed
Keywords: haspatch added
Owner: changed from macports-tickets@… to raimue@…
Summary: bash escapes non-latin symbols when completing paths with spacesbash @4.3.33_0: escapes non-latin symbols when completing paths with spaces

comment:3 Changed 10 years ago by xeron (Ivan Larionov)

Looks like bash was forced to use bundled readline in r87677. Also looks like debian's version of bash uses bundled readline as well. So I'm not sure my patch is correct.

But I has this issue with bundled one.

comment:4 Changed 10 years ago by xeron (Ivan Larionov)

Ok this is interesting.

If I rebuild bash using Portfile from trunk it works OK.

So the issue is in bash which was installed by macports using prebuild package. It could be some environment differences or something.

Last edited 10 years ago by xeron (Ivan Larionov) (previous) (diff)

comment:5 Changed 10 years ago by raimue (Rainer Müller)

I can reproduce this with the archive from the buildbot. If I build it locally it works as expected. I will try to force a rebuild on the buildbot.

Maybe readline behaves differently based on the locale settings during build? Although I tried local builds with LC_ALL=en_US.utf8 and LC_ALL=C, both work as expected.

comment:6 Changed 10 years ago by raimue (Rainer Müller)

Status: newassigned

comment:7 Changed 9 years ago by xeron (Ivan Larionov)

Looks like rebuilding doesn't help. @4.3.39_0 installed from prebuilt package still has this issue.

comment:8 Changed 8 years ago by xeron (Ivan Larionov)

Can't reproduce this with bash 4.4. Feel free to close.

Last edited 8 years ago by xeron (Ivan Larionov) (previous) (diff)

comment:9 Changed 8 years ago by raimue (Rainer Müller)

Resolution: worksforme
Status: assignedclosed

Thanks for the confirmation.

Note: See TracTickets for help on using tickets.