Chrysostomus / manjaro-zsh-config

Zsh configuration package for manjaro
MIT License
124 stars 52 forks source link

manjaro-zsh-config "termsupport" window title section overrides expected default oh-my-zsh title behavior #46

Open trinitronx opened 1 year ago

trinitronx commented 1 year ago

Description of Issue

This package's /usr/share/zsh/manjaro-zsh-config file defines zsh hooks that override expected window title behavior of oh-my-zsh.

This becomes very noticeable in manjaro-sway with sworkstyle icons and other things that depend on window titles being set properly.

Manjaro Sway edition installs manjaro-sway/oh-my-zsh by default, including oh-my-zsh in /usr/share/oh-my-zsh/.

Problem Code

Right now the code here results in window title with only the current working directory (and 15-char left truncation). Support for currently running command in window title is broken.

It looks like the title setting code was added in this commit, and probably copied directly from oh-my-zsh (see termsupport.zsh somewhere around this commit). Later, functions were renamed with prefix mzc_ to avoid namespace collision. However, the functions effectively conflict with each other due to having side-effects (e.g. setting the shared-state of the window title).

The hook ordering places mzc_* after omz_* functions managing the same state. Effectively this results in manjaro-zsh-config overriding oh-my-zsh, whether or not the user wants this.

Duplicating this zsh hook here results in a few problems:

Debug Info

Here are the current zsh hooks on manjaro-sway, in order of execution:

Expand for zhooks output

```zsh $ zhooks ## From this plugin: https://github.com/agkozak/zhooks precmd_functions: _p9k_do_nothing _pyenv_virtualenv_hook omz_termsupport_precmd _zsh_highlight_main__precmd_hook mzc_termsupport_precmd mzc_termsupport_cwd _zsh_autosuggest_start _p9k_precmd preexec_functions: _p9k_preexec1 omz_termsupport_preexec _zsh_highlight_preexec_hook mzc_termsupport_preexec _p9k_preexec2 zshexit_functions: _p9k_worker_cleanup _gitstatus_cleanup_POWERLEVEL9K-_p9k_ ```