Bash 4.4 released
lists.gnu.org
lists.gnu.org
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.
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)
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…
PS1="\@ \h \w> "
This displays current time, host and working dir.
See here:
http://superuser.com/questions/175799/does-bash-have-a-hook-...
There is way to hook into command execution. And that piece of code you hook in could look at a variable called PS0 and process it the way Bash 4.4 does it now.
This new PS0 might provide a pre-execution hook of its own. If it performs $(....) command substitution (like PS1 does!), it provides a way of executing arbitrary code. If the entire prompt is "$(some-command ...)" and that command produces no output, then you have a de facto pure hook.
http://lists.gnu.org/archive/html/bug-bash/2016-09/msg00018....
http://lists.gnu.org/archive/html/bug-bash/2016-09/msg00019....
> 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!
EDIT I seem to have misread that description. So it is possible, that's brilliant news!
https://lists.gnu.org/archive/html/bug-bash/2015-12/msg00031...
Edit: it looks like you must use \1 and \2 instead of \[ and \].
Yikes, finally you can use `echo "Hello World!"`
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.
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.
#!/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[0] https://www.quora.com/What-is-the-reason-for-some-of-the-Lin...
Apple takes issue with patents-related wording in GPL3 and doesn't want to be subject to GPL3 (while they're OK with GPL2). Hence not distributing GPL3-licensed software.
Uh, what? Could someone explain this one, please?
# time; echo hola
-bash: syntax error near unexpected token `echo' time ${cmd}; foo
where cmd happens to be unset. Conceptually, that's a valid script, because `time` standalone is a valid script. No reason it should generate an error.$ time
real 0m0.002s user 0m0.000s sys 0m0.000s
After four releases versions bash starts to get regular syntax?
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.https://www.reddit.com/r/linux/comments/52z087/bash_44_relea...
(Chet Ramey [1] is the primary maintainer of GNU bash.)
This is a terse description of the new features added to bash-4.4 since the release of bash-4.3...
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
hahaha
Next release it will check the variables $INSIDE_ACME, $INSIDE_SUBLIME and $INSIDE_NOTEPADPLUSPLUS
Next release would probably check $INSIDE_SCREEN, $INSIDE_BROWSER, $INSIDE_PHONE, $INSIDE_VR, $INSIDE_PAPER, $INSIDE_HUMAN
However, more generic solution shall be used, like checking out parent process of current session to determine environment in which bash is running.
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)