-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Longtime user and fan of z.sh. After many attempts to no avail at debugging the following, I'm opening this issue for discussion.
I'm running two machines, a macOS (local) and an Ubuntu (remote,) with the same dotfiles and shell configuration. Both are running the same version of bash (5.1.16(1).) Both shells are interactive login shells. And yet, when z.sh is sourced, the macOS shell prompt experiences a short but highly noticeable lag on each Return press, while the Ubuntu prompt is rendered instantly.
I was wondering if anyone else is experiencing the same issue (or similar) and how to fix — if possible.
Shell environment settings: (also available in my repo)
~/.bash_profilewhich sources three different bash files where.shell/utils.shis relevant for our case~/.shell/utilswhich exportsPROMPT_COMMANDwithhistory -aand at the end of the file sourcesz.shfrom a specific directory:
export PROMPT_COMMAND="history -a"
# other lines...
# point to and source z in order to track and build dir list
. $HOME/.bin/z.sh
- No other changes to
PROMPT_COMMANDor other shell configurations occur at the shell level after sourcingz.shabove.
As such, the PROMPT_COMMAND reads: history -a (_z --add "$(command pwd -P 2>/dev/null)" 2>/dev/null &);
$HOME/.bin/z.sh reflects the latest version from the master brach.
This has been also tested on a fresh macOS virtual machine with the same results.