Some cleanup
This commit is contained in:
parent
f3407959a6
commit
0bd1676978
@ -86,7 +86,7 @@ that resolve to a location outside the HOME are not allowed.
|
||||
''')
|
||||
|
||||
opt('shell_integration', 'inherit', long_text='''
|
||||
Control the shell integration on the remote host. See ref:`shell_integration`
|
||||
Control the shell integration on the remote host. See :ref:`shell_integration`
|
||||
for details on how this setting works. The special value :code:`inherit` means
|
||||
use the setting from kitty.conf. This setting is useful for overriding
|
||||
integration on a per-host basis.''')
|
||||
|
||||
@ -71,9 +71,9 @@ fi
|
||||
data_started="n"
|
||||
data_complete="n"
|
||||
if [ -z "$HOSTNAME" ]; then
|
||||
hostname=$(hostname 2> /dev/null)
|
||||
hostname=$(command hostname 2> /dev/null)
|
||||
if [ -z "$hostname" ]; then
|
||||
hostname=$(hostnamectl hostname 2> /dev/null)
|
||||
hostname=$(command hostnamectl hostname 2> /dev/null)
|
||||
if [ -z "$hostname" ]; then
|
||||
hostname="_";
|
||||
fi
|
||||
@ -84,7 +84,7 @@ fi
|
||||
# ensure $HOME is set
|
||||
if [ -z "$HOME" ]; then HOME=~; fi
|
||||
# ensure $USER is set
|
||||
if [ -z "$USER" ]; then USER=$(whoami 2> /dev/null); fi
|
||||
if [ -z "$USER" ]; then USER=$(command whoami 2> /dev/null); fi
|
||||
|
||||
# ask for the SSH data
|
||||
data_password="DATA_PASSWORD"
|
||||
@ -108,7 +108,7 @@ untar_and_read_env() {
|
||||
# extract the tar file atomically, in the sense that any file from the
|
||||
# tarfile is only put into place after it has been fully written to disk
|
||||
|
||||
tdir=$(mktemp -d "$HOME/.kitty-ssh-kitten-untar-XXXXXXXXXXXX");
|
||||
tdir=$(command mktemp -d "$HOME/.kitty-ssh-kitten-untar-XXXXXXXXXXXX");
|
||||
[ $? = 0 ] || die "Creating temp directory failed";
|
||||
read_n_bytes_from_tty "$1" | command base64 -d | command tar xjf - --no-same-owner -C "$tdir";
|
||||
data_file="$tdir/data.sh";
|
||||
@ -189,7 +189,7 @@ detect_python() {
|
||||
}
|
||||
|
||||
parse_passwd_record() {
|
||||
printf "%s" "$(grep -o '[^:]*$')"
|
||||
printf "%s" "$(command grep -o '[^:]*$')"
|
||||
}
|
||||
|
||||
using_getent() {
|
||||
@ -218,7 +218,7 @@ using_id() {
|
||||
|
||||
using_passwd() {
|
||||
if [ -f "/etc/passwd" -a -r "/etc/passwd" ]; then
|
||||
output=$(grep "^$USER:" /etc/passwd 2>/dev/null)
|
||||
output=$(command grep "^$USER:" /etc/passwd 2>/dev/null)
|
||||
if [ $? = 0 ]; then
|
||||
login_shell=$(echo $output | parse_passwd_record);
|
||||
if login_shell_is_ok; then return 0; fi
|
||||
@ -229,7 +229,7 @@ using_passwd() {
|
||||
|
||||
using_python() {
|
||||
if detect_python; then
|
||||
output=$($python -c "import pwd, os; print(pwd.getpwuid(os.geteuid()).pw_shell)")
|
||||
output=$(command $python -c "import pwd, os; print(pwd.getpwuid(os.geteuid()).pw_shell)")
|
||||
if [ $? = 0 ]; then
|
||||
login_shell=$output;
|
||||
if login_shell_is_ok; then return 0; fi
|
||||
@ -321,7 +321,7 @@ case "$KITTY_SHELL_INTEGRATION" in
|
||||
;;
|
||||
(*)
|
||||
# not blank
|
||||
q=$(printf "%s" "$KITTY_SHELL_INTEGRATION" | grep '\bno-rc\b')
|
||||
q=$(printf "%s" "$KITTY_SHELL_INTEGRATION" | command grep '\bno-rc\b')
|
||||
if [ -z "$q" ]; then
|
||||
exec_with_shell_integration
|
||||
# exec failed, unset
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user