feat(terminal): harden terminal abbreviations and functions
- Wrap Kitty-specific abbreviations and functions with $TERM checks - Resurrect WezTerm abbreviations and wrap with $TERM_PROGRAM checks - Add check_fish_deps function to list and verify all fish-related dependencies - Update README to recommend Kitty and WezTerm and document requirements - Improve fallback behavior for rg outside of Kitty
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
# Copyright (C) 2026 Rootiest
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
function check_fish_deps --description "Check all fish-related dependencies"
|
||||
set -l required fish fisher starship fzf zoxide direnv paru
|
||||
set -l integrations wakatime tailscale
|
||||
set -l recommended eza lsd bat btop dust duf prettyping most rg lazygit lazydocker trash kitty wezterm
|
||||
|
||||
function __print_dep
|
||||
set -l dep $argv[1]
|
||||
if type -q $dep
|
||||
set_color green
|
||||
echo -n " "
|
||||
set_color normal
|
||||
echo -n "$dep "
|
||||
set_color brblack
|
||||
echo "(Found at "(type -p $dep)")"
|
||||
set_color normal
|
||||
else
|
||||
set_color red
|
||||
echo -n " "
|
||||
set_color normal
|
||||
echo -n "$dep "
|
||||
set_color brblack
|
||||
echo "(Not installed)"
|
||||
set_color normal
|
||||
end
|
||||
end
|
||||
|
||||
set_color cyan; echo "Required Dependencies:"; set_color normal
|
||||
for dep in $required
|
||||
__print_dep $dep
|
||||
end
|
||||
echo ""
|
||||
|
||||
set_color cyan; echo "Integrations:"; set_color normal
|
||||
for dep in $integrations
|
||||
__print_dep $dep
|
||||
end
|
||||
echo ""
|
||||
|
||||
set_color cyan; echo "Recommended Dependencies:"; set_color normal
|
||||
for dep in $recommended
|
||||
__print_dep $dep
|
||||
end
|
||||
echo ""
|
||||
|
||||
functions -e __print_dep
|
||||
end
|
||||
@@ -2,6 +2,9 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
function clone --wraps=clone-in-kitty --description 'alias clone=clone-in-kitty'
|
||||
clone-in-kitty $argv
|
||||
|
||||
if test "$TERM" != xterm-kitty
|
||||
echo "Error: The 'clone' command requires Kitty terminal." >&2
|
||||
return 1
|
||||
end
|
||||
clone-in-kitty $argv
|
||||
end
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
function clonet --wraps='clone-in-kitty --type=tab' --description 'alias clonet=clone-in-kitty --type=tab'
|
||||
clone-in-kitty --type=tab $argv
|
||||
|
||||
if test "$TERM" != xterm-kitty
|
||||
echo "Error: The 'clonet' command requires Kitty terminal." >&2
|
||||
return 1
|
||||
end
|
||||
clone-in-kitty --type=tab $argv
|
||||
end
|
||||
|
||||
+5
-2
@@ -2,6 +2,9 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
function rg --description 'alias rg=rg --hyperlink-format=kitty'
|
||||
command rg --hyperlink-format=kitty $argv
|
||||
|
||||
if test "$TERM" = xterm-kitty
|
||||
command rg --hyperlink-format=kitty $argv
|
||||
else
|
||||
command rg $argv
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2,6 +2,11 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
function split --description 'Run a command in a new Kitty split'
|
||||
if test "$TERM" != xterm-kitty
|
||||
echo "Error: The 'split' command requires Kitty terminal." >&2
|
||||
return 1
|
||||
end
|
||||
|
||||
set -l location hsplit
|
||||
|
||||
switch $argv[1]
|
||||
|
||||
@@ -2,5 +2,9 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
function spwin --wraps='~/.config/kitty/spawn-window.sh' --description 'alias spwin=~/.config/kitty/spawn-window.sh'
|
||||
if test "$TERM" != xterm-kitty
|
||||
echo "Error: The 'spwin' command requires Kitty terminal." >&2
|
||||
return 1
|
||||
end
|
||||
~/.config/kitty/spawn-window.sh $argv
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user