Shell integration: More builtin commands
This commit is contained in:
parent
7ea4270c88
commit
df1a99a974
@ -13,7 +13,7 @@ if [[ -n "$KITTY_BASH_INJECT" ]]; then
|
|||||||
if [[ -z "$KITTY_BASH_ETC_LOCATION" ]]; then KITTY_BASH_ETC_LOCATION="/etc"; fi
|
if [[ -z "$KITTY_BASH_ETC_LOCATION" ]]; then KITTY_BASH_ETC_LOCATION="/etc"; fi
|
||||||
|
|
||||||
_ksi_sourceable() {
|
_ksi_sourceable() {
|
||||||
[[ -f "$1" && -r "$1" ]] && return 0; return 1;
|
[[ -f "$1" && -r "$1" ]] && builtin return 0; builtin return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ "$kitty_bash_inject" == *"posix"* ]]; then
|
if [[ "$kitty_bash_inject" == *"posix"* ]]; then
|
||||||
@ -273,8 +273,8 @@ _ksi_main() {
|
|||||||
builtin local venv="${VIRTUAL_ENV}/bin/activate"
|
builtin local venv="${VIRTUAL_ENV}/bin/activate"
|
||||||
builtin local sourced=""
|
builtin local sourced=""
|
||||||
_ksi_s_is_ok() {
|
_ksi_s_is_ok() {
|
||||||
[[ -z "$sourced" && "$KITTY_CLONE_SOURCE_STRATEGIES" == *",$1,"* ]] && return 0
|
[[ -z "$sourced" && "$KITTY_CLONE_SOURCE_STRATEGIES" == *",$1,"* ]] && builtin return 0
|
||||||
return 1
|
builtin return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
if _ksi_s_is_ok "venv" && [ -n "${VIRTUAL_ENV}" -a -r "$venv" ]; then
|
if _ksi_s_is_ok "venv" && [ -n "${VIRTUAL_ENV}" -a -r "$venv" ]; then
|
||||||
@ -340,7 +340,7 @@ clone-in-kitty() {
|
|||||||
"") break;;
|
"") break;;
|
||||||
-h|--help)
|
-h|--help)
|
||||||
builtin printf "%s\n\n%s\n" "Clone the current bash session into a new kitty window." "For usage instructions see: https://sw.kovidgoyal.net/kitty/shell-integration/#clone-shell"
|
builtin printf "%s\n\n%s\n" "Clone the current bash session into a new kitty window." "For usage instructions see: https://sw.kovidgoyal.net/kitty/shell-integration/#clone-shell"
|
||||||
return
|
builtin return
|
||||||
;;
|
;;
|
||||||
*) data="$data,a=$(builtin printf "%s" "$1" | builtin command base64)";;
|
*) data="$data,a=$(builtin printf "%s" "$1" | builtin command base64)";;
|
||||||
esac
|
esac
|
||||||
|
|||||||
@ -362,8 +362,8 @@ _ksi_deferred_init() {
|
|||||||
builtin local venv="${VIRTUAL_ENV}/bin/activate"
|
builtin local venv="${VIRTUAL_ENV}/bin/activate"
|
||||||
builtin local sourced=""
|
builtin local sourced=""
|
||||||
_ksi_s_is_ok() {
|
_ksi_s_is_ok() {
|
||||||
[[ -z "$sourced" && "$KITTY_CLONE_SOURCE_STRATEGIES" == *",$1,"* ]] && return 0
|
[[ -z "$sourced" && "$KITTY_CLONE_SOURCE_STRATEGIES" == *",$1,"* ]] && builtin return 0
|
||||||
return 1
|
builtin return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
if _ksi_s_is_ok "venv" && [[ -n "${VIRTUAL_ENV}" && -r "$venv" ]]; then
|
if _ksi_s_is_ok "venv" && [[ -n "${VIRTUAL_ENV}" && -r "$venv" ]]; then
|
||||||
@ -421,7 +421,7 @@ clone-in-kitty() {
|
|||||||
"") break;;
|
"") break;;
|
||||||
-h|--help)
|
-h|--help)
|
||||||
builtin printf "%s\n\n%s\n" "Clone the current zsh session into a new kitty window." "For usage instructions see: https://sw.kovidgoyal.net/kitty/shell-integration/#clone-shell"
|
builtin printf "%s\n\n%s\n" "Clone the current zsh session into a new kitty window." "For usage instructions see: https://sw.kovidgoyal.net/kitty/shell-integration/#clone-shell"
|
||||||
return
|
builtin return
|
||||||
;;
|
;;
|
||||||
*) data="$data,a=$(builtin printf "%s" "$1" | builtin command base64)";;
|
*) data="$data,a=$(builtin printf "%s" "$1" | builtin command base64)";;
|
||||||
esac
|
esac
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user