17 Commits
Author SHA1 Message Date
tianrkingandtianrking 76b606ec59 Guard shell integration against unset ZSH_NAME (#7942)
Co-authored-by: tianrking <tianrking@users.noreply.github.com>
2026-07-16 19:55:52 +02:00
DevHegemony 50056b5fbe check that ps1 has not changed before restoring it 2025-05-03 06:51:31 -07:00
Koichi Murase dbabb97581 fix: skip FreshLine by semantic integration in ble.sh
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.
2025-02-09 13:38:26 -07:00
Kreijstal 364a158b6c Add Fallbacks for Setting WEZTERM_HOST in Non-Systemd and Minimal Environments
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.
2025-02-08 14:24:23 -07:00
Andrew Gunnerson 2d0c5cddc9 shell-integration: Fix syntax error due to missing double quote
This fixes a regression introduced in commit
24702de74a.

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
2024-09-15 15:32:43 -07:00
Dominique Martinet 24702de74a shell integration: check for saved PS1 value before using it
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.
2024-09-15 05:47:22 -07:00
Antoine Cotten bcf77a711c shell-integration: be resilient to nounset 2024-09-14 06:33:59 -07:00
Wez Furlong 0dedc7684d shell-integration: update bash-preexec.sh
It seems like newer versions collide with older versions(!)

https://fosstodon.org/@jimw@mefi.social/111797116746117103

so let's update to the newest version.
2024-01-23 06:19:39 -07:00
Saurabh Charde 1d3427dc77 shell integration: check existence of hostname command before calling
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
2023-01-24 12:21:41 -08:00
Wez Furlong e725d68f08 docs: shell-integration: cover the new built-in user-vars 2023-01-23 10:50:49 -07:00
Wez Furlong d8ffbd6b31 shell integration: set some handy user vars by default 2023-01-23 09:29:55 -07:00
Wez Furlong 78ea214a96 avoid modern bash feature when testing for BLE_VERSION
refs: #1572
2022-01-22 08:07:50 -07:00
Sandro Jäckel 56e9a9af7e Add support for blesh hooks 2022-01-21 09:22:58 -08:00
Sandro Jäckel 3cc26cc7b8 Tell shellcheck the right shell that not everyting lights up like a christmas tree 2022-01-21 09:22:58 -08:00
Sandro Jäckel 66b6f9e6d0 Passthru exit code for other commands in $PROMPT_COMMAND 2021-12-10 20:50:38 -08:00
Wez Furlong 8e0fd3717e wezterm.sh: improve non-bash/non-zsh behavior
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
2021-01-30 12:42:01 -08:00
Wez Furlong eb22808761 wezterm: add shell integration for bash and zsh
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.
2020-11-14 09:07:56 -08:00