[PATCH] Fix custom program's completions when initial word is set

2018-11-23 Thread Luca Boccassi
The change to fix mid-word initial completion inadvertently broke custom
command completion.
To reproduce:

cat > repro<
---
Dear Maintainer,

noticed this a bit too late after some more testing. This fix appears
to work, let me know if you'd like a different solution.
Thanks!

 bashline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bashline.c b/bashline.c
index d56cd79d..f2d17a70 100644
--- a/bashline.c
+++ b/bashline.c
@@ -1583,7 +1583,7 @@ attempt_shell_completion (text, start, end)
  /* command completion if programmable completion fails */
  /* If we have a completion for the initial word, we can prefer that */
  in_command_position = s == start && (iw_compspec || STREQ (n, text)); 
/* XXX */
- foundcs = foundcs && (iw_compspec == 0);
+ foundcs = foundcs && (iw_compspec == 0 || in_command_position == 0);
}
   /* empty command name following command separator */
   else if (s >= e && n[0] == '\0' && text[0] == '\0' && start > 0 &&
-- 
2.19.1




URL-links not activated – Bash v. 4.4.23

2018-11-23 Thread Ricky Tigg
To reproduce: on Linux with GUI in GUI terminal – e.g. gnome-terminal –
execute following command then attempt to click present URL links:

$ rpm -qfi `which FBReader`
(...)

Actual result: it fails.

Yet while the following,command is executed, same URL links can be clicked:

$ rpm -qfi `which FBReader` | sed -n '16,17p'
URL : http://www.fbreader.org/
Bug URL : https://bugz.fedoraproject.org/fbreader

Additional information:
OS: Fedora

$ echo $SHELL
/bin/bash
$ dnf list installed | grep bash
bash.x86_64
4.4.23-5.fc29   @anaconda
bash-completion.noarch
1:2.8-3.fc29   @anaconda


Re: URL-links not activated – Bash v. 4.4.23

2018-11-23 Thread Greg Wooledge
On Fri, Nov 23, 2018 at 02:21:04PM +0100, Ricky Tigg wrote:
> To reproduce: on Linux with GUI in GUI terminal – e.g. gnome-terminal –
> execute following command then attempt to click present URL links:
> 
> $ rpm -qfi `which FBReader`
> (...)
> 
> Actual result: it fails.
> 
> Yet while the following,command is executed, same URL links can be clicked:
> 
> $ rpm -qfi `which FBReader` | sed -n '16,17p'
> URL : http://www.fbreader.org/
> Bug URL : https://bugz.fedoraproject.org/fbreader

This has nothing to do with bash.  These "URL links" are a feature of
your terminal emulator, and you will need to send your bug report to
the correct mailing list, bug tracker or web forum for your terminal
emulator.



Re: URL-links not activated – Bash v. 4.4.23

2018-11-23 Thread Ricky Tigg
Thanks for the tip!

pe 23. marrask. 2018 klo 14.26 Greg Wooledge (wool...@eeg.ccf.org)
kirjoitti:

> On Fri, Nov 23, 2018 at 02:21:04PM +0100, Ricky Tigg wrote:
> > To reproduce: on Linux with GUI in GUI terminal – e.g. gnome-terminal –
> > execute following command then attempt to click present URL links:
> >
> > $ rpm -qfi `which FBReader`
> > (...)
> >
> > Actual result: it fails.
> >
> > Yet while the following,command is executed, same URL links can be
> clicked:
> >
> > $ rpm -qfi `which FBReader` | sed -n '16,17p'
> > URL : http://www.fbreader.org/
> > Bug URL : https://bugz.fedoraproject.org/fbreader
>
> This has nothing to do with bash.  These "URL links" are a feature of
> your terminal emulator, and you will need to send your bug report to
> the correct mailing list, bug tracker or web forum for your terminal
> emulator.
>


Bash removes unrequested characters in bracket expressions (not a range).

2018-11-23 Thread Bize Ma
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: Linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu'
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash'
-DSHELL -DHAVE_CONFIG_H   -I.  -I../. -I.././include -I.././lib
-Wdate-time -D_FORTIFY_SOURCE=2 -g -O2
-fdebug-prefix-map=/build/bash-7fckc0/bash-4.4=.
-fstack-protector-strong -Wformat -Werror=format-security -Wall
-no-pie -Wno-parentheses -Wno-format-security
uname output: Linux io 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2
(2018-10-27) x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu

Bash Version: 4.4
Patch Level: 12
Release Status: release



Description:

Bash is removing characters not explicitly listed in a bracket
expression (character range).
In this example, it is removing digits from other languages.

Also tested (and it fails) in bash 3.{0,1,3} 4.{1,2,3} and 5.0
Not a problem in bash 2.{0,1}



Repeat-By:

If the characters are a problem: please visit:
https://unix.stackexchange.com/q/483743/265604

$ a='0123456789 ٠١٢٣٤٥٦٧٨٩ ۰۱۲۳۴۵۶۷۸۹ ߀߁߂߃߄߅߆߇߈߉ ०१२३४५६७८९'
$ echo "${a//[0123456789]}"
  ۰۱۲۳۴۵۶۷۸۹ ߀߁߂߃߄߅߆߇߈߉ ०१२३४५६७८९