From 8f6fbe238969ecb22fbdae75450a9f8705c9f979 Mon Sep 17 00:00:00 2001 From: Håvard Bartnes Date: Tue, 28 Mar 2023 12:50:05 +0200 Subject: feat(upgrade): add verbosity settings Co-authored-by: Carlo Sala Closes #11574 Closes #11579 --- lib/cli.zsh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/cli.zsh b/lib/cli.zsh index fed00d21d..ba3e39eb5 100644 --- a/lib/cli.zsh +++ b/lib/cli.zsh @@ -776,10 +776,11 @@ function _omz::update { local last_commit=$(builtin cd -q "$ZSH"; git rev-parse HEAD) # Run update script + zstyle -s ':omz:update' verbose verbose_mode || verbose_mode=default if [[ "$1" != --unattended ]]; then - ZSH="$ZSH" command zsh -f "$ZSH/tools/upgrade.sh" --interactive || return $? + ZSH="$ZSH" command zsh -f "$ZSH/tools/upgrade.sh" -i -v $verbose_mode || return $? else - ZSH="$ZSH" command zsh -f "$ZSH/tools/upgrade.sh" || return $? + ZSH="$ZSH" command zsh -f "$ZSH/tools/upgrade.sh" -v $verbose_mode || return $? fi # Update last updated file -- cgit v1.2.3-70-g09d2 From 1ad167dfac325a9f92e0693c70d0ab3f7c4c574b Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Mon, 3 Apr 2023 23:14:36 +0200 Subject: feat(init)!: allow turning off aliases for libs and plugins (#11550) BREAKING CHANGE: the previous zstyle setting to disable `lib/directories.zsh` aliases has been changed to the new syntax: `zstyle ':omz:lib:directories' aliases no`. See https://github.com/ohmyzsh/ohmyzsh#skip-aliases to see other ways you can use this setting. Co-authored-by: Carlo Sala --- README.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++++----- lib/directories.zsh | 6 ------ oh-my-zsh.sh | 45 ++++++++++++++++++++++++++++++++++++-------- 3 files changed, 86 insertions(+), 19 deletions(-) (limited to 'lib') diff --git a/README.md b/README.md index 4f0aeb7b4..556d4c8c5 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,9 @@ To learn more, visit [ohmyz.sh](https://ohmyz.sh), follow [@ohmyzsh](https://twi - [Manual Installation](#manual-installation) - [Installation Problems](#installation-problems) - [Custom Plugins and Themes](#custom-plugins-and-themes) + - [Skip aliases](#skip-aliases) - [Getting Updates](#getting-updates) + - [Updates verbosity](#updates-verbosity) - [Manual Updates](#manual-updates) - [Uninstalling Oh My Zsh](#uninstalling-oh-my-zsh) - [How do I contribute to Oh My Zsh?](#how-do-i-contribute-to-oh-my-zsh) @@ -276,16 +278,58 @@ If you have many functions that go well together, you can put them as a `XYZ.plu If you would like to override the functionality of a plugin distributed with Oh My Zsh, create a plugin of the same name in the `custom/plugins/` directory and it will be loaded instead of the one in `plugins/`. -### Remove directories aliases +### Skip aliases -If you want to skip ohmyzsh default -[directories aliases](https://github.com/ohmyzsh/ohmyzsh/blob/master/lib/directories.zsh) you can add the -following snippet to your `zshrc`, before loading `oh-my-zsh.sh` script: + -```zsh +If you want to skip default Oh My Zsh aliases (those defined in `lib/*` files) or plugin aliases, +you can use the settings below in your `~/.zshrc` file, **before Oh My Zsh is loaded**. Note that +there are many different ways to skip aliases, depending on your needs. + +```sh +# Skip all aliases, in lib files and enabled plugins +zstyle ':omz:*' aliases no + +# Skip all aliases in lib files +zstyle ':omz:lib:*' aliases no +# Skip only aliases defined in the directories.zsh lib file +zstyle ':omz:lib:directories' aliases no + +# Skip all plugin aliases +zstyle ':omz:plugins:*' aliases no +# Skip only the aliases from the git plugin +zstyle ':omz:plugins:git' aliases no +``` + +You can combine these in other ways taking into account that more specific scopes takes precedence: + +```sh +# Skip all plugin aliases, except for the git plugin +zstyle ':omz:plugins:*' aliases no +zstyle ':omz:plugins:git' aliases yes +``` + +A previous version of this feature was using the setting below, which has been removed: + +```sh zstyle ':omz:directories' aliases no ``` +Instead, you can now use the following: + +```sh +zstyle ':omz:lib:directories' aliases no +``` + +#### Notice + +> This feature is currently in a testing phase and it may be subject to change in the future. +> It is also not currently compatible with plugin managers such as zpm or zinit, which don't +> source the init script (`oh-my-zsh.sh`) where this feature is implemented in. + +> It is also not currently aware of "aliases" that are defined as functions. Example of such +> are `gccd`, `ggf`, or `ggl` functions from the git plugin. + ## Getting Updates By default, you will be prompted to check for updates every 2 weeks. You can choose other update modes by adding a line to your `~/.zshrc` file, **before Oh My Zsh is loaded**: diff --git a/lib/directories.zsh b/lib/directories.zsh index 13b680c19..8927a56ad 100644 --- a/lib/directories.zsh +++ b/lib/directories.zsh @@ -4,12 +4,6 @@ setopt auto_pushd setopt pushd_ignore_dups setopt pushdminus -# add (uncommented): -# zstyle ':omz:directories' aliases no -# to your `zshrc` before loading `oh-my-zsh.sh` -# to disable the following aliases and functions - -zstyle -T ':omz:directories' aliases || return 0 alias -g ...='../..' alias -g ....='../../..' diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 363cfca8b..20d2e354c 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -146,22 +146,51 @@ if command mkdir "${ZSH_COMPDUMP}.lock" 2>/dev/null; then command rm -rf "$ZSH_COMPDUMP.zwc.old" "${ZSH_COMPDUMP}.lock" fi +_omz_source() { + local context filepath="$1" + + # Construct zstyle context based on path + case "$filepath" in + lib/*) context="lib:${filepath:t:r}" ;; # :t = lib_name.zsh, :r = lib_name + plugins/*) context="plugins:${filepath:h2:t}" ;; # :h2 = plugins/plugin_name, :t = plugin_name + esac + + local disable_aliases=0 + zstyle -T ":omz:${context}" aliases || disable_aliases=1 + + # Back up alias names prior to sourcing + local -a aliases_pre galiases_pre + if (( disable_aliases )); then + aliases_pre=("${(@k)aliases}") + galiases_pre=("${(@k)galiases}") + fi + + # Source file from $ZSH_CUSTOM if it exists, otherwise from $ZSH + if [[ -f "$ZSH_CUSTOM/$filepath" ]]; then + source "$ZSH_CUSTOM/$filepath" + elif [[ -f "$ZSH/$filepath" ]]; then + source "$ZSH/$filepath" + fi + + # Unset all aliases that don't appear in the backed up list of aliases + if (( disable_aliases )); then + local -a disabled + # ${var:|array} gets the list of items in var not in array + disabled=("${(@k)aliases:|aliases_pre}" "${(@k)galiases:|galiases_pre}") + (( $#disabled == 0 )) || unalias "${(@)disabled}" + fi +} + # Load all of the config files in ~/oh-my-zsh that end in .zsh # TIP: Add files you don't want in git to .gitignore for config_file ("$ZSH"/lib/*.zsh); do - custom_config_file="$ZSH_CUSTOM/lib/${config_file:t}" - [[ -f "$custom_config_file" ]] && config_file="$custom_config_file" - source "$config_file" + _omz_source "${config_file:t2}" done unset custom_config_file # Load all of the plugins that were defined in ~/.zshrc for plugin ($plugins); do - if [[ -f "$ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh" ]]; then - source "$ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh" - elif [[ -f "$ZSH/plugins/$plugin/$plugin.plugin.zsh" ]]; then - source "$ZSH/plugins/$plugin/$plugin.plugin.zsh" - fi + _omz_source "plugins/$plugin/$plugin.plugin.zsh" done unset plugin -- cgit v1.2.3-70-g09d2 From 8d23fbd6964b8446bbc73ff04507362d1fd49eb5 Mon Sep 17 00:00:00 2001 From: Christian Parpart Date: Tue, 4 Apr 2023 16:47:13 +0200 Subject: feat(termsupport): add contour terminal (#11599) Signed-off-by: Christian Parpart --- lib/termsupport.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index 80ca7ef78..5bc418761 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -17,7 +17,7 @@ function title { : ${2=$1} case "$TERM" in - cygwin|xterm*|putty*|rxvt*|konsole*|ansi|mlterm*|alacritty|st*|foot) + cygwin|xterm*|putty*|rxvt*|konsole*|ansi|mlterm*|alacritty|st*|foot|contour*) print -Pn "\e]2;${2:q}\a" # set window name print -Pn "\e]1;${1:q}\a" # set tab name ;; -- cgit v1.2.3-70-g09d2 From 25c2c3a4683be60c3526858be960ee6ce1249245 Mon Sep 17 00:00:00 2001 From: Alexander Schlarb Date: Sun, 16 May 2021 18:58:38 +0200 Subject: feat(lib): send OSC 7 on directory change for more supported terminals (#9914) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously this was only emitted on macOS with Apple's Terminal.app (and compatible clones like iTerm2), but it is used by other terminal emulators as well to obtain the actual current working directory wiht symlinks intact. All non-supporting terminal emulators tested gracefully ignored this value, so emit this on these as well in case they (or some other app masquarading as them) add future support for this value. Closes #9914 Co-authored-by: Marc Cornellà --- lib/termsupport.zsh | 72 +++++++++++++++++++++++++++++++++++------------------ 1 file changed, 48 insertions(+), 24 deletions(-) (limited to 'lib') diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index 5bc418761..cf8f08741 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -109,28 +109,52 @@ if [[ -z "$INSIDE_EMACS" || "$INSIDE_EMACS" = vterm ]]; then add-zsh-hook preexec omz_termsupport_preexec fi -# Keep Apple Terminal.app's current working directory updated -# Based on this answer: https://superuser.com/a/315029 -# With extra fixes to handle multibyte chars and non-UTF-8 locales - -if [[ "$TERM_PROGRAM" == "Apple_Terminal" ]] && [[ -z "$INSIDE_EMACS" ]]; then - # Emits the control sequence to notify Terminal.app of the cwd - # Identifies the directory using a file: URI scheme, including - # the host name to disambiguate local vs. remote paths. - function update_terminalapp_cwd() { - emulate -L zsh - - # Percent-encode the host and path names. - local URL_HOST URL_PATH - URL_HOST="$(omz_urlencode -P $HOST)" || return 1 - URL_PATH="$(omz_urlencode -P $PWD)" || return 1 - - # Undocumented Terminal.app-specific control sequence - printf '\e]7;%s\a' "file://$URL_HOST$URL_PATH" - } - - # Use a precmd hook instead of a chpwd hook to avoid contaminating output - add-zsh-hook precmd update_terminalapp_cwd - # Run once to get initial cwd set - update_terminalapp_cwd +# Keep terminal emulator's current working directory correct, +# even if the current working directory path contains symbolic links +# +# References: +# - Apple's Terminal.app: https://superuser.com/a/315029 +# - iTerm2: https://iterm2.com/documentation-escape-codes.html (iTerm2 Extension / CurrentDir+RemoteHost) +# - Konsole: https://bugs.kde.org/show_bug.cgi?id=327720#c1 +# - libvte (gnome-terminal, mate-terminal, …): https://bugzilla.gnome.org/show_bug.cgi?id=675987#c14 +# Apparently it had a bug before ~2012 were it would display the unknown OSC 7 code +# +# As of May 2021 mlterm, PuTTY, rxvt, screen, termux & xterm simply ignore the unknown OSC. + +# Don't define the function if we're inside Emacs +if [[ -n "$INSIDE_EMACS" ]]; then + return fi + +# Don't define the function if we're in an unsupported terminal +case "$TERM" in + # all of these either process OSC 7 correctly or ignore entirely + xterm*|putty*|rxvt*|konsole*|mlterm*|alacritty|screen*|tmux*) ;; + contour*|foot*) ;; + *) + # Terminal.app and iTerm2 process OSC 7 correctly + case "$TERM_PROGRAM" in + Apple_Terminal|iTerm.app) ;; + *) return ;; + esac ;; +esac + +# Emits the control sequence to notify many terminal emulators +# of the cwd +# +# Identifies the directory using a file: URI scheme, including +# the host name to disambiguate local vs. remote paths. +function omz_termsupport_cwd { + # Percent-encode the host and path names. + local URL_HOST URL_PATH + URL_HOST="$(omz_urlencode -P $HOST)" || return 1 + URL_PATH="$(omz_urlencode -P $PWD)" || return 1 + + # common control sequence (OSC 7) to set current host and path + printf "\e]7;%s\a" "file://${URL_HOST}${URL_PATH}" +} + +# Use a precmd hook instead of a chpwd hook to avoid contaminating output +# i.e. when a script or function changes directory without `cd -q`, chpwd +# will be called the output may be swallowed by the script or function. +add-zsh-hook precmd omz_termsupport_cwd -- cgit v1.2.3-70-g09d2 From 5b11e70a9617c6e248fd6947e84016bd8c37028e Mon Sep 17 00:00:00 2001 From: Erin Schlarb Date: Thu, 20 Apr 2023 13:32:32 +0200 Subject: fix(cli): execute as expected if `ksh_arrays` is set (#11629) --- lib/cli.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/cli.zsh b/lib/cli.zsh index ba3e39eb5..561c1b98b 100644 --- a/lib/cli.zsh +++ b/lib/cli.zsh @@ -11,7 +11,7 @@ function omz { # Subcommand functions start with _ so that they don't # appear as completion entries when looking for `omz` - (( $+functions[_omz::$command] )) || { + (( ${+functions[_omz::$command]} )) || { _omz::help return 1 } -- cgit v1.2.3-70-g09d2 From c5208867f1eb46f722e040b239150817abec87a6 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Tue, 2 May 2023 12:41:01 +0200 Subject: feat(theme-and-appearance): allow disabling gnu-ls in bsd To disable gnu-ls (`gls`) even if it's installed in freeBSD and macOS you can set it up with: ```zsh zstyle ':omz:lib:theme-and-appearance' gnu-ls no ``` Closes #11647 --- README.md | 13 +++++++++++++ lib/theme-and-appearance.zsh | 36 +++++++++++++++++------------------- 2 files changed, 30 insertions(+), 19 deletions(-) (limited to 'lib') diff --git a/README.md b/README.md index 556d4c8c5..650fb00ea 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ To learn more, visit [ohmyz.sh](https://ohmyz.sh), follow [@ohmyzsh](https://twi - [Manual Installation](#manual-installation) - [Installation Problems](#installation-problems) - [Custom Plugins and Themes](#custom-plugins-and-themes) + - [Disable GNU ls in macOS and freeBSD systems](#disable-gnu-ls) - [Skip aliases](#skip-aliases) - [Getting Updates](#getting-updates) - [Updates verbosity](#updates-verbosity) @@ -278,6 +279,18 @@ If you have many functions that go well together, you can put them as a `XYZ.plu If you would like to override the functionality of a plugin distributed with Oh My Zsh, create a plugin of the same name in the `custom/plugins/` directory and it will be loaded instead of the one in `plugins/`. +### Disable GNU ls in macOS and freeBSD systems + + + +The default behaviour in Oh My Zsh is to use GNU `ls` even in macOS and freeBSD systems if it's installed (as +`gls` command) when enabling colorized `ls` in `lib/theme-and-appearance.zsh`. If you want to disable this +behaviour you can use zstyle-based config before sourcing `oh-my-zsh.sh`: + +```zsh +zstyle ':omz:lib:theme-and-appearance' gnu-ls no +``` + ### Skip aliases diff --git a/lib/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh index d8859b04c..96bdb00e5 100644 --- a/lib/theme-and-appearance.zsh +++ b/lib/theme-and-appearance.zsh @@ -20,10 +20,25 @@ if command diff --color /dev/null{,} &>/dev/null; then } fi - # Don't set ls coloring if disabled [[ "$DISABLE_LS_COLORS" != true ]] || return 0 +# Default coloring for BSD-based ls +export LSCOLORS="Gxfxcxdxbxegedabagacad" + +# Default coloring for GNU-based ls +if [[ -z "$LS_COLORS" ]]; then + # Define LS_COLORS via dircolors if available. Otherwise, set a default + # equivalent to LSCOLORS (generated via https://geoff.greer.fm/lscolors) + if (( $+commands[dircolors] )); then + [[ -f "$HOME/.dircolors" ]] \ + && source <(dircolors -b "$HOME/.dircolors") \ + || source <(dircolors -b) + else + export LS_COLORS="di=1;36:ln=35:so=32:pi=33:ex=31:bd=34;46:cd=34;43:su=30;41:sg=30;46:tw=30;42:ow=30;43" + fi +fi + function test-ls-args { local cmd="$1" # ls, gls, colorls, ... local args="${@[2,-1]}" # arguments except the first one @@ -50,7 +65,7 @@ case "$OSTYPE" in test-ls-args ls -G && alias ls='ls -G' # Only use GNU ls if installed and there are user defaults for $LS_COLORS, # as the default coloring scheme is not very pretty - [[ -n "$LS_COLORS" || -f "$HOME/.dircolors" ]] \ + zstyle -T ':omz:lib:theme-and-appearance' gnu-ls \ && test-ls-args gls --color \ && alias ls='gls --color=tty' ;; @@ -64,20 +79,3 @@ case "$OSTYPE" in esac unfunction test-ls-args - - -# Default coloring for BSD-based ls -export LSCOLORS="Gxfxcxdxbxegedabagacad" - -# Default coloring for GNU-based ls -if [[ -z "$LS_COLORS" ]]; then - # Define LS_COLORS via dircolors if available. Otherwise, set a default - # equivalent to LSCOLORS (generated via https://geoff.greer.fm/lscolors) - if (( $+commands[dircolors] )); then - [[ -f "$HOME/.dircolors" ]] \ - && source <(dircolors -b "$HOME/.dircolors") \ - || source <(dircolors -b) - else - export LS_COLORS="di=1;36:ln=35:so=32:pi=33:ex=31:bd=34;46:cd=34;43:su=30;41:sg=30;46:tw=30;42:ow=30;43" - fi -fi -- cgit v1.2.3-70-g09d2 From dcff7a7f0854591ee1b4f25266f292ec1b1904eb Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Tue, 9 May 2023 12:05:15 +0200 Subject: fix(theme-and-appearance): make bsd `ls` to be default --- lib/theme-and-appearance.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/theme-and-appearance.zsh b/lib/theme-and-appearance.zsh index 96bdb00e5..585e969d8 100644 --- a/lib/theme-and-appearance.zsh +++ b/lib/theme-and-appearance.zsh @@ -65,7 +65,7 @@ case "$OSTYPE" in test-ls-args ls -G && alias ls='ls -G' # Only use GNU ls if installed and there are user defaults for $LS_COLORS, # as the default coloring scheme is not very pretty - zstyle -T ':omz:lib:theme-and-appearance' gnu-ls \ + zstyle -t ':omz:lib:theme-and-appearance' gnu-ls \ && test-ls-args gls --color \ && alias ls='gls --color=tty' ;; -- cgit v1.2.3-70-g09d2 From 902b79e635fedf4a12542d2ed8bd29665d3d281c Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Tue, 23 May 2023 08:43:47 +0200 Subject: fix(functions): use `command` env Closes #11709 --- lib/functions.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/functions.zsh b/lib/functions.zsh index 1d85ea38a..a252d0a33 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -5,7 +5,7 @@ function zsh_stats() { } function uninstall_oh_my_zsh() { - env ZSH="$ZSH" sh "$ZSH/tools/uninstall.sh" + command env ZSH="$ZSH" sh "$ZSH/tools/uninstall.sh" } function upgrade_oh_my_zsh() { -- cgit v1.2.3-70-g09d2 From 50c678687e73d1433f278b7bb7f168e8fa817670 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Thu, 8 Jun 2023 18:47:05 +0200 Subject: fix(termsupport): fix pwd report for Konsole (#11730) The Konsole terminal shows an error if the host is provided in the OSC 7 sequence. Fixes #11730 --- lib/termsupport.zsh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index cf8f08741..145982705 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -150,8 +150,11 @@ function omz_termsupport_cwd { URL_HOST="$(omz_urlencode -P $HOST)" || return 1 URL_PATH="$(omz_urlencode -P $PWD)" || return 1 + # Konsole errors if the HOST is provided + [[ -z "$KONSOLE_VERSION" ]] || URL_HOST="" + # common control sequence (OSC 7) to set current host and path - printf "\e]7;%s\a" "file://${URL_HOST}${URL_PATH}" + printf "\e]7;file://%s%s\e\\" "${URL_HOST}" "${URL_PATH}" } # Use a precmd hook instead of a chpwd hook to avoid contaminating output -- cgit v1.2.3-70-g09d2 From cb8b677488c7a20278917af58dfccd72cd40e1b1 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Sun, 11 Jun 2023 17:02:48 +0200 Subject: fix(termsupport): don't report current working directory in SSH sessions (#11703) --- lib/termsupport.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index 145982705..6d969503d 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -121,8 +121,8 @@ fi # # As of May 2021 mlterm, PuTTY, rxvt, screen, termux & xterm simply ignore the unknown OSC. -# Don't define the function if we're inside Emacs -if [[ -n "$INSIDE_EMACS" ]]; then +# Don't define the function if we're inside Emacs or in an SSH session (#11696) +if [[ -n "$INSIDE_EMACS" || -n "$SSH_CLIENT" || -n "$SSH_TTY" ]]; then return fi -- cgit v1.2.3-70-g09d2 From 03a0d5bbaedc732436b5c67b166cde954817cc2f Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Thu, 24 Aug 2023 17:20:24 +0200 Subject: fix(clipboard): load clipboard on usage Closes #8827 --- lib/clipboard.zsh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/clipboard.zsh b/lib/clipboard.zsh index 2f3b6bcad..4b37abc9b 100644 --- a/lib/clipboard.zsh +++ b/lib/clipboard.zsh @@ -100,8 +100,8 @@ function detect-clipboard() { fi } -# Detect at startup. A non-zero exit here indicates that the dummy clipboards were set, -# which is not really an error. If the user calls them, they will attempt to redetect -# (for example, perhaps the user has now installed xclip) and then either print an error -# or proceed successfully. -detect-clipboard || true +function clipcopy clippaste { + unfunction clipcopy clippaste + detect-clipboard || true # let one retry + "$0" "$@" +} -- cgit v1.2.3-70-g09d2 From ccce2e1cfdf5b9680f691a402e288d9cf6ce272a Mon Sep 17 00:00:00 2001 From: James Cuzella Date: Thu, 31 Aug 2023 15:35:33 -0600 Subject: fix(termsupport): match all `foot`-like terminfo (#11868) --- lib/termsupport.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index 6d969503d..a800e651f 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -17,7 +17,7 @@ function title { : ${2=$1} case "$TERM" in - cygwin|xterm*|putty*|rxvt*|konsole*|ansi|mlterm*|alacritty|st*|foot|contour*) + cygwin|xterm*|putty*|rxvt*|konsole*|ansi|mlterm*|alacritty|st*|foot*|contour*) print -Pn "\e]2;${2:q}\a" # set window name print -Pn "\e]1;${1:q}\a" # set tab name ;; -- cgit v1.2.3-70-g09d2 From 8428442ff0e0114fab32b90443911b11a4b7f5df Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Thu, 19 Oct 2023 23:24:55 +0200 Subject: fix(termsupport): add workaround for directory tracking issues in Konsole Fixes #11683 Related: 50c6786 --- lib/termsupport.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index a800e651f..d170ffcbf 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -151,7 +151,7 @@ function omz_termsupport_cwd { URL_PATH="$(omz_urlencode -P $PWD)" || return 1 # Konsole errors if the HOST is provided - [[ -z "$KONSOLE_VERSION" ]] || URL_HOST="" + [[ -z "$KONSOLE_PROFILE_NAME" && -z "$KONSOLE_DBUS_SESSION" ]] || URL_HOST="" # common control sequence (OSC 7) to set current host and path printf "\e]7;file://%s%s\e\\" "${URL_HOST}" "${URL_PATH}" -- cgit v1.2.3-70-g09d2