Re: Bash-5.1-rc1 available

2020-11-02 Thread Bob Proulx
Chet Ramey wrote:
> Tomas Janousek wrote:
> > Chet Ramey wrote:
> >> Yes, you can disable bracketed paste mode. I'll make sure that turning off
> >> bracketed paste mode disables the active region for incremental searches.
> > 
> > Would you please consider making this configurable separately? I'd love to
> > keep bracketed paste mode enabled, but I find the highlighting annoying 
> > (and a
> > bit buggy, more on that later). It seems I'm not alone:
> > https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=972344

I would also much prefer if the highlight was separate.

> I'm going to see what the reaction is with bash-5.1 and go from there. The
> entire rationale for including this feature was to highlight the text a
> bracketed paste inserts. Since there was no separate use, and the
> contributed patch didn't include a configuration option, I didn't add one.

Highlighting the region is a completely separate concept from
bracketed paste mode as the region is used in many completely
unrelated places.  It pains me that they are coupled.

Bob



Re: Regression - extra terminal escape codes emitted

2020-11-02 Thread Chet Ramey
On 11/2/20 12:29 PM, Joe Nahmias wrote:
> Hello bash team,
> 
> I've noticed a regression in one of my test suites for a program using the
> python pexpect library, after upgrading from 5.0.3(1)-release to
> 5.1.0(1)-rc1. 

Thanks for the report. These are the escape sequences that enable and
disable the terminal's bracketed paste mode, which is enabled by default.
Bash-5.1-rc2 will inhibit these sequences if the terminal name is "dumb"
or unknown.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRUc...@case.eduhttp://tiswww.cwru.edu/~chet/



Regression - extra terminal escape codes emitted

2020-11-02 Thread Joe Nahmias
Hello bash team,

I've noticed a regression in one of my test suites for a program using the
python pexpect library, after upgrading from 5.0.3(1)-release to
5.1.0(1)-rc1. Here's a minimal test case (in python) I've created:

#!/usr/bin/python3

import os
import pexpect

ps1 = "MYspECIalpROmpt: "
env = {
"HOME": os.environ["HOME"],
"LANG": "en_US.UTF-8",
"LOGNAME": os.environ["LOGNAME"],
"PS1": ps1,
"PATH": "/usr/local/bin:/usr/bin:/bin",
"TERM": "dumb",
"USER": os.environ["USER"],
}
expects = [pexpect.TIMEOUT, "(\r\n)?" + ps1]

child = pexpect.spawn("bash --norc", env=env, echo=False)
pos = child.expect(expects, timeout=1)
child.sendline('echo $BASH_VERSION')
pos = child.expect(expects, timeout=1)
if pos:
print(f'Got BASH_VERSION="{child.before.decode("utf-8")}".')
else:
print("expect() timed-out!")
print(f"Debug info:\n{str(child)}")

child.sendline("exit")
child.close()
# EOF


When running on a machine with bash 5.1.0(1)-rc1 installed, I get:
$ ./test.py
5.1.0(1)-rc1SION="
".
Debug info:

command: /usr/bin/bash
args: ['/usr/bin/bash', '--norc']
buffer (last 100 chars): b''
before (last 100 chars): b'\x1b[?2004l\r5.1.0(1)-rc1\r\n\x1b[?2004h'
after: b'MYspECIalpROmpt: '
match: 
match_index: 1
exitstatus: None
flag_eof: False
pid: 2018364
child_fd: 5
closed: False
timeout: 30
delimiter: 
logfile: None
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1


After I downgrade to bash 5.0.18(1)-release, I get:
$ ./test.py
Got BASH_VERSION="5.0.18(1)-release".
Debug info:

command: /usr/bin/bash
args: ['/usr/bin/bash', '--norc']
buffer (last 100 chars): b''
before (last 100 chars): b'5.0.18(1)-release'
after: b'\r\nMYspECIalpROmpt: '
match: 
match_index: 1
exitstatus: None
flag_eof: False
pid: 2019518
child_fd: 5
closed: False
timeout: 30
delimiter: 
logfile: None
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1


Please let me know if you need any additional information.
--Joe



Re: Bash-5.1-rc1 available

2020-11-02 Thread Chet Ramey
On 11/2/20 10:12 AM, Tomas Janousek wrote:
> Hi Chet,
> 
> On Mon, Oct 26, 2020 at 10:12:59AM -0400, Chet Ramey wrote:
>> Yes, you can disable bracketed paste mode. I'll make sure that turning off
>> bracketed paste mode disables the active region for incremental searches.
> 
> Would you please consider making this configurable separately? I'd love to
> keep bracketed paste mode enabled, but I find the highlighting annoying (and a
> bit buggy, more on that later). It seems I'm not alone:
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=972344

I'm going to see what the reaction is with bash-5.1 and go from there. The
entire rationale for including this feature was to highlight the text a
bracketed paste inserts. Since there was no separate use, and the
contributed patch didn't include a configuration option, I didn't add one.

> 
> Also, the changelog says "when enabled", but there's currently no way to
> disable it:

You mean there is no separate way to disable it, which is true.

> 
>> f. New active mark and face feature: when enabled, it will highlight the text
>>inserted by a bracketed paste (the `active region') and the text found by
>>incremental and non-incremental history searches.
> 
> Now for the "bit buggy" part:
> 
> 1. PS1='$ '
> 2. echo -n x
> 3. paste something
> 4. press left arrow
> 
> Now the terminal shows "x$somethingg" instead of "x$ something".

If Readline doesn't start in column 0, all bets are off. The redisplay
needs to know where the physical cursor is in order to make decisions
about how and where to overwrite characters. If it doesn't know there
is a character in the last column, it's not going to try to overwrite it.
If it doesn't have to rewrite the prompt, it's not going to: it will
simply move the cursor to the physical location at the end of the prompt
string and output the line.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRUc...@case.eduhttp://tiswww.cwru.edu/~chet/



Re: Bash-5.1-rc1 available

2020-11-02 Thread Tomas Janousek
Hi Chet,

On Mon, Oct 26, 2020 at 10:12:59AM -0400, Chet Ramey wrote:
> Yes, you can disable bracketed paste mode. I'll make sure that turning off
> bracketed paste mode disables the active region for incremental searches.

Would you please consider making this configurable separately? I'd love to
keep bracketed paste mode enabled, but I find the highlighting annoying (and a
bit buggy, more on that later). It seems I'm not alone:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=972344

Also, the changelog says "when enabled", but there's currently no way to
disable it:

> f. New active mark and face feature: when enabled, it will highlight the text
>inserted by a bracketed paste (the `active region') and the text found by
>incremental and non-incremental history searches.

Now for the "bit buggy" part:

1. PS1='$ '
2. echo -n x
3. paste something
4. press left arrow

Now the terminal shows "x$somethingg" instead of "x$ something".

(Yeah, I can work around this by having PROMPT_COMMAND detect that current
column is not 0 and output an additional newline, but I'd really prefer to
just disable the highlighting as I don't like it.)

Thanks for considering it!

Regards,
-- 
Tomáš Janoušek, a.k.a. Pivník, a.k.a. Liskni_si, https://work.lisk.in/



Re: Problem with reverse-i-search in 5.1.0(1)-rc1

2020-11-02 Thread Chet Ramey
On 11/2/20 9:17 AM, Detlef Vollmann wrote:

> BTW, if you want me to check it you could send me a patch or push
> a commit to git.savannah.gnu.org/git/bash.

It will be in the next devel branch push.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRUc...@case.eduhttp://tiswww.cwru.edu/~chet/



Re: Problem with reverse-i-search in 5.1.0(1)-rc1

2020-11-02 Thread Detlef Vollmann

On 11/1/20 8:58 PM, Chet Ramey wrote:

On 10/31/20 11:00 AM, Detlef Vollmann wrote:

Hello,

since Bash-5.1-rc1  doesn't work for me as previously.
I have the following entries in my history:
man a
man b

Now I type ' m a n' and get:
(reverse-i-search)`man': man b

Now I type '' again.
What I would expect (and what I got with 5.0) is:
(reverse-i-search)`man': man a

Instead I get
(reverse-i-search)`': man b

Note the empty search string.


Thanks for the report. It's not easy to reproduce, and, as you later note,
requires the `C' or `POSIX' locales and things to be done in a certain
order, but I believe I was able to track it down. It will be fixed in
bash-5.1-rc2.


Thanks,
  Detlef

BTW, if you want me to check it you could send me a patch or push
a commit to git.savannah.gnu.org/git/bash.