Switch to using BASH_VERSINFO rather than BASH_VERSION, since it
provides structured data.
BASH_VERSINFO
A readonly array variable whose members hold version information for this instance of bash. The values assigned to the array members are as follows:
BASH_VERSINFO[0] The major version number (the release).
BASH_VERSINFO[1] The minor version number (the version).
BASH_VERSINFO[2] The patch level.
BASH_VERSINFO[3] The build version.
BASH_VERSINFO[4] The release status (e.g., beta1).
BASH_VERSINFO[5] The value of MACHTYPE.
When release status is not "release", bash builds are in debug mode and
output extra information which disturbs the integration.
Closes#5473
For URLs where there's fewer characters left to the right edge of the
window than the number of escape characters in the line, the next line
would be included in the URL, as if the URL went all the way to the
right edge.
For example with a 40 chars wide terminal, if you run:
echo -e '\e[31m1\e[m https://github.com/kovidgoyal/kitty\ntest'
And launch the hints kitten, you'll see that test on the next line will
be included in the URL.
This happened because the calculation for filling the rest of the line
with NUL characters counted the escape characters as well as the visible
characters, so it filled in too few characters.
This is a regression introduced in commit 91966712.
The prewarm zygote imports the world. shell.py had a top level import
for readline. Which means readline was being imported pre-fork. And of
course as is traditional with Apple libedit is not fork safe. Probably
because it initializes its internal IO routines based on the stdio
handles at time of import which are the handles kitty gets from launchd
Apparently libedit doesn't work in the forked process when the parent
process is run via Launch Services. I cant be bothered to investigate
why, given that libedit is closed source. macOS users will just have to
live without history/completion in the ask kitten until I get around to
writing a replacement for readline/libedit.
And on a personal note, macOS >> Necrotizing fasciitis
Fixes#5447
Happened because reading the locale uses cocoa APIs and they are not fork
safe, so it was moved to after prewarm forking, but at that point the
default child env had already been set.
Fixes#5439