
Bash 4.4 released - okket
http://lists.gnu.org/archive/html/bug-bash/2016-09/msg00018.html
======
olau
A little anecdote: there was a case of O(N^2) in readline with long lines.
Essentially a bug in the redisplay logic. It affected Bash, mysql/psql,
Python, etc.

After having suffered from this for some years, last year that annoyed me
enough to start digging into readline to figure out what was causing it. In
the end, that prompted Chet Ramey to come up with a fix which looks like it is
now being released!

I promised myself that when this one was fixed, I'd look into why most
readline shells can go nuts when you resize them - somehow they don't always
discover that the line width has changed.

~~~
JonathonW
> I promised myself that when this one was fixed, I'd look into why most
> readline shells can go nuts when you resize them - somehow they don't always
> discover that the line width has changed.

Possibly related?

> Use pselect(2), if available, to wait for input before calling read(2), so a
> SIGWINCH can interrupt it, since it doesn't interrupt read(2).

(from the Readline-7.0 release notes)

------
p4bl0
I really like this one:

    
    
        jj. New prompt string: PS0.  Expanded and displayed by interactive
            shells after reading a complete command but before executing it.
    

I currently use my PS1 for a lot of dirty things that would have their place
in such a PS0 :).

Now, I just have to wait until Bash 4.4 lands in Debian…

~~~
raziel2p
Like what? Out of curiosity.

~~~
CJefferson
You could use PS0 to make your terminal title be "running <name of program>"
when a program is running, then "directory <dir name>" when just on a prompt
(that might be too busy for some people, but I'd like to know if a program is
actively running in the terminal title).

~~~
p4bl0
See my other comment with a link to a blogpost that explains how to do just
this before having PS0 :).

~~~
CJefferson
Ah, cool. Didn't realise there was a hack around it (that might still be
useful on non-4.4 systems).

------
siteshwar
Here is the announcement on mailing list:

[http://lists.gnu.org/archive/html/bug-
bash/2016-09/msg00018....](http://lists.gnu.org/archive/html/bug-
bash/2016-09/msg00018.html)

[http://lists.gnu.org/archive/html/bug-
bash/2016-09/msg00019....](http://lists.gnu.org/archive/html/bug-
bash/2016-09/msg00019.html)

------
ramblenode
One Readline feature I have been looking forward to:

> c. The editing mode indicators can now be strings and are user-settable (new
> `emacs-mode-string', `vi-cmd-mode-string' and `vi-ins-mode-string'
> variables). Mode strings can contain invisible character sequences. Setting
> mode strings to null strings restores the defaults.

So now I can get the prompt to change color depending on the mode!

~~~
0942v8653
It seems that this has not been fixed (or maybe I'm just doing something
wrong?):

[https://lists.gnu.org/archive/html/bug-
bash/2015-12/msg00031...](https://lists.gnu.org/archive/html/bug-
bash/2015-12/msg00031.html)

Edit: it looks like you must use \1 and \2 instead of \\[ and \\].

------
_jomo
Archive link: [https://archive.is/n9Qb7](https://archive.is/n9Qb7)

------
_jomo
> ll. Posix-mode shells now allow double quotes to quote the history expansion
> character.

Yikes, finally you can use `echo "Hello World!"`

~~~
etatoby
I never understood that feature. I have been putting `set +H` for decades on
every profile of every system I touch.

------
tambourine_man
OS X has been stuck in 3.2.57 for years due to licensing.

I like being able to SSH into a fresh Linux box and feel at home, but at some
point, they'll be so different that I might as well permanently switch to Zsh.

I keep hoping for Apple to adopt Fish, last I heard the guy works there, and
it's totally Apple's thing to have its own shell. It would be fun at least.

~~~
hibbelig
I gave in and installed bash from Homebrew.

~~~
mieko
This is what I do, and just so others know:

Realize that if your personal account's shell is pointed into the homebrew
installation in /usr/local, and you implode homebrew or wipe /usr/local, you
won't be able to start a terminal until your shell is changed or the binary
exists. Solving this without Terminal.app being able to launch is a minor
annoyance.

~~~
RJIb8RBYxzAMX9u
Right, so have Terminal run this instead:

    
    
      #!/bin/sh
      
      for shell in \
        /opt/local/bin/bash \
        /bin/bash \
        /bin/sh
      do
        [ -x "$shell" ] && exec "$shell" -l
      done
      
      echo >&2 "ERROR: No valid shell found!"
      read -r -s -n 1 -t 10 dummy
      exit 1

~~~
QuercusMax
If you are able to run a script with #!/bin/sh, and /bin/sh becomes un-
executable during the execution of your script, you're definitely having a bad
time. :D

------
atdt
> The shell now allows `time ; othercommand' to time null commands.

Uh, what? Could someone explain this one, please?

~~~
slipo
Pre 4.4 - ';' (command separator) was ignored by time

    
    
      # time; echo hola
      -bash: syntax error near unexpected token `echo'

~~~
etatoby
Why would you want to time nothing? What does it output, real 0s user 0s
system 0s?

~~~
thiagoharry
Why would you want to multiply by 1 or sum zero? You probably wouldn't need to
do it, but computers and scripts aren't so smart as people and always follow
code literally. For them is important a language having less irregularities
and exceptional rules. If "" is a valid command and you have the syntax "time
[COMMAND];", why not allow "time;"?

------
agentgt

        o.  There is a new address@hidden family of operators to transform the
        value of `parameter'.
    

Can anyone show an example of that? I'm not sure I understand that feature.

~~~
slipo
Interesting addition ${PARAMETER@OPERATOR} parameter expansion. Taken from the
new docs, see:

[https://www.reddit.com/r/linux/comments/52z087/bash_44_relea...](https://www.reddit.com/r/linux/comments/52z087/bash_44_released/)

~~~
opk
I'm not sure how wise that is. It doesn't exactly lead to readable scripts.
Zsh has had the equivalent feature with the syntax ${(operator)parameter) for
over two decades so plenty of time for more operators to be added. It is very
powerful but worse than perl for code that looks like line noise.

------
erelde
Cool stuff. Weird numbering though.

------
0xmohit
I was led to think that Chet's bash page [0] might contain details about the
4.4 release. Unfortunately, not.

(Chet Ramey [1] is the primary maintainer of GNU bash.)

[0]
[https://tiswww.case.edu/php/chet/bash/bashtop.html](https://tiswww.case.edu/php/chet/bash/bashtop.html)

[1] [https://tiswww.case.edu/php/chet/](https://tiswww.case.edu/php/chet/)

~~~
pja
It does now:
[https://tiswww.case.edu/php/chet/bash/NEWS](https://tiswww.case.edu/php/chet/bash/NEWS)

 _This is a terse description of the new features added to bash-4.4 since the
release of bash-4.3..._

------
euphoria83
One of the most important open-source projects in my view. Great work!

------
smcdow
Still waiting on a formal way to denote namespaces in bash

------
nanis
Really, posting a link to `git.savannah.gnu.org/cgit/` was probably not a nice
thing.

~~~
okket
Why? There is no official release posting I could find, not on the website,
not on the mailing lists. ~~Also, cgit seems to cope with the traffic.~~

Edit: I see. Sorry. My browser was caching all requests to cgit. Please have
the mods replace the link with something better.

Meanwhile, please visit the link from _jomo:
[https://archive.is/n9Qb7](https://archive.is/n9Qb7)

~~~
orf
It's down right now.

------
pgl
This may be a better link: [http://lists.gnu.org/archive/html/bug-
bash/2016-09/msg00018....](http://lists.gnu.org/archive/html/bug-
bash/2016-09/msg00018.html)

------
i4k
> Bash now checks $INSIDE_EMACS as well as $EMACS > when deciding whether or >
> not bash is being run in a GNU Emacs shell window.

hahaha

Next release it will check the variables $INSIDE_ACME, $INSIDE_SUBLIME and
$INSIDE_NOTEPADPLUSPLUS

~~~
rgtk
Bash and Emacs are under the same umbrella. This software is part of GNU
system and systems tend to incorporate its part to make it more maintainable.

However, more generic solution shall be used, like checking out parent process
of current session to determine environment in which bash is running.

~~~
i4k
The problem is not only with bash, but with entire gnu ecosystem. Bash disable
something _ONLY_ when the parent process is EMACS is totally nonsense. Bash
should check for some behavior, instead of some technology... because I'm sure
other editors can behave similarly when executing bash inside some buffer.

Doing software this way makes bash and emacs working well, but hard to make
other softwares interact with both of them... Sublime, acme, micro, and so on
can benefit of a better solution. In the same way, other shell should work
fine inside emacs (M-x ansi-term).

But software design is not expected here (see downvotes)

