It started after recent upgrade. Version : 3.6.1_1 Terminal is kitty - Version : 0.31.0 Freebsd 14 release. installed from latest binary repo. error: Welcome to fish, the friendly interactive shell Type help for instructions on how to use fish type: Could not find 'sudo' test: Expected a combining operator like '-a' at index 5 -n /usr/local/share/kitty/terminfo -a file = ^ Standard input (line 114): and test -n "$TERMINFO" -a "file" = (type -t sudo) ^ in function '__ksi_schedule' in event handler: handler for generic event 'fish_prompt' I don't have sudo installed because I use doas in my system. thnx in advance
The problem actually lies within kitty, not fish. It's in the file /usr/local/share/kitty/shell-integration/fish/vendor_conf.d/kitty-shell-integration.fish at line 114. It looks cosmetic to me; the error message is annoying but I don't think it will alter fish's behavior. And I think this patch will fix it: --- /usr/local/share/kitty/shell-integration/fish/vendor_conf.d/kitty-shell-integration.fish.orig 2023-11-25 16:27:56.135191000 -0700 +++ /usr/local/share/kitty/shell-integration/fish/vendor_conf.d/kitty-shell-integration.fish 2023-11-25 16:27:50.220297000 -0700 @@ -111,7 +111,7 @@ # Note that neither alias nor function is recursive in fish so if the user defines an alias/function # for sudo it will be clobbered by us, so only install this if sudo is not already function if not contains "no-sudo" $_ksi - and test -n "$TERMINFO" -a "file" = (type -t sudo) + and test -n "$TERMINFO" -a "file" = "(type -t sudo)" and not test -r "/usr/share/terminfo/x/xterm-kitty" -o -r "/usr/share/terminfo/78/xterm-kitty" # Ensure terminfo is available in sudo function sudo
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=9792df1e16be41a313cc76824bbc3a8bb558d5f1 commit 9792df1e16be41a313cc76824bbc3a8bb558d5f1 Author: Alan Somers <asomers@FreeBSD.org> AuthorDate: 2023-12-01 14:30:06 +0000 Commit: Nicola Vitale <nivit@FreeBSD.org> CommitDate: 2023-12-01 14:34:10 +0000 x11/kitty: Fix error with kitty+fish without sudo If a user has fish as shell and sudo is not installed, then kitty prints the following error: type: Could not find 'sudo' test: Expected a combining operator like '-a' at index 5 -n /usr/local/share/kitty/terminfo -a file = ^ Standard input (line 114): and test -n "$TERMINFO" -a "file" = (type -t sudo) ^ in function '__ksi_schedule' in event handler: handler for generic event 'fish_prompt' - Add a patch to fix that error and to tests the presence of the xterm-kitty file in DATADIR - Bump PORTREVISION PR: 275339 x11/kitty/Makefile | 4 +++- ...n_fish_vendor__conf.d_kitty-shell-integration.fish (new) | 13 +++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-)
Committed, thank you for the PR!