mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-25 17:52:02 +02:00
Explicitly use builtin and command
This commit is contained in:
@@ -203,7 +203,7 @@ parse_passwd_record() {
|
|||||||
using_getent() {
|
using_getent() {
|
||||||
cmd=$(command -v getent)
|
cmd=$(command -v getent)
|
||||||
if [ -n "$cmd" ]; then
|
if [ -n "$cmd" ]; then
|
||||||
output=$($cmd passwd $USER 2>/dev/null)
|
output=$(command $cmd passwd $USER 2>/dev/null)
|
||||||
if [ $? = 0 ]; then
|
if [ $? = 0 ]; then
|
||||||
login_shell=$(echo $output | parse_passwd_record);
|
login_shell=$(echo $output | parse_passwd_record);
|
||||||
if login_shell_is_ok; then return 0; fi
|
if login_shell_is_ok; then return 0; fi
|
||||||
@@ -215,7 +215,7 @@ using_getent() {
|
|||||||
using_id() {
|
using_id() {
|
||||||
cmd=$(command -v id)
|
cmd=$(command -v id)
|
||||||
if [ -n "$cmd" ]; then
|
if [ -n "$cmd" ]; then
|
||||||
output=$($cmd -P $USER 2>/dev/null)
|
output=$(command $cmd -P $USER 2>/dev/null)
|
||||||
if [ $? = 0 ]; then
|
if [ $? = 0 ]; then
|
||||||
login_shell=$(echo $output | parse_passwd_record);
|
login_shell=$(echo $output | parse_passwd_record);
|
||||||
if login_shell_is_ok; then return 0; fi
|
if login_shell_is_ok; then return 0; fi
|
||||||
|
|||||||
@@ -55,9 +55,9 @@ builtin typeset -gi _ksi_state
|
|||||||
# _ksi_deferred_init.
|
# _ksi_deferred_init.
|
||||||
typeset -gi _ksi_fd
|
typeset -gi _ksi_fd
|
||||||
{
|
{
|
||||||
zmodload zsh/system && (( $+builtins[sysopen] )) && {
|
builtin zmodload zsh/system && (( $+builtins[sysopen] )) && {
|
||||||
{ [[ -w $TTY ]] && sysopen -o cloexec -wu _ksi_fd -- $TTY } ||
|
{ [[ -w $TTY ]] && builtin sysopen -o cloexec -wu _ksi_fd -- $TTY } ||
|
||||||
{ [[ -w /dev/tty ]] && sysopen -o cloexec -wu _ksi_fd -- /dev/tty }
|
{ [[ -w /dev/tty ]] && builtin sysopen -o cloexec -wu _ksi_fd -- /dev/tty }
|
||||||
}
|
}
|
||||||
} 2>/dev/null || (( _ksi_fd = 1 ))
|
} 2>/dev/null || (( _ksi_fd = 1 ))
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ _ksi_deferred_init() {
|
|||||||
# Recognized options: no-cursor, no-title, no-prompt-mark, no-complete.
|
# Recognized options: no-cursor, no-title, no-prompt-mark, no-complete.
|
||||||
builtin local -a opt
|
builtin local -a opt
|
||||||
opt=(${(s: :)KITTY_SHELL_INTEGRATION})
|
opt=(${(s: :)KITTY_SHELL_INTEGRATION})
|
||||||
unset KITTY_SHELL_INTEGRATION
|
builtin unset KITTY_SHELL_INTEGRATION
|
||||||
|
|
||||||
# The directory where kitty-integration is located: /.../shell-integration/zsh.
|
# The directory where kitty-integration is located: /.../shell-integration/zsh.
|
||||||
builtin local self_dir="${functions_source[_ksi_deferred_init]:A:h}"
|
builtin local self_dir="${functions_source[_ksi_deferred_init]:A:h}"
|
||||||
|
|||||||
Reference in New Issue
Block a user