ble.sh keeps track of the cursor position in the terminal
display---including the horizontal position relative to the bottom of
the terminal---based on the terminal control sequences that it sends.
However, with WezTerm's shell integration, WezTerm inserts the newline
(FreshLine) in PROMPT_COMMAND, which breaks the cursor position
tracking of ble.sh. The needed cursor position adjustment at the end
of the command execution is already performed by ble.sh, so WezTerm
does not need to adjust it. In this patch, we skip the request for
FreshLine.
This PR addresses issues with setting the WEZTERM_HOST environment variable in environments lacking certain hostname utilities, specifically hostname and hostnamectl, which may not be available in minimal or non-Systemd setups.
On bash it's possible to hit ^C before we remembered the PS1 which would
cause the shell to end up with an empty PS1, making it unclear that the
^C actually worked as there is no prompt left.
I'm not sure I understand the need to mess with the variable every time
(could just add the OSC codes if not already present and never remove
them?), but at least make it so we don't end up with an empty prompt
line by checking the saved value isn't empty.
base arch linux installation doesn't include `hostname` binary as it's part of
a separate `inetutils` package, use systemd `hostnamectl` which is available in
all systemd-based distributions
When we're not being run by bash or zsh then we can't use
bashisms to test that we're bash or zsh.
Just use good old posix test syntax instead.
refs: #447
This commit provides a shell script that hooks into bash and zsh
to enable OSC 7 and semantic zones.
The packaging for Fedora and Debian deploys that script to
/etc/profile.d.