比康。從 shell 退出不正確,在 Ranger 中打開

比康。從 shell 退出不正確,在 Ranger 中打開

安裝了bicon-git,這是寫在.bashrc中的

# hack to launch bicon if not launched
if ! [[ "$(ps -p $(ps -p $(echo $$) -o ppid=) -o comm=)" =~ 'bicon'* ]]; then
  bicon.bin
fi

發射遊騎兵

[~] -> ranger  

製作

Shift + s  

問題

[dir] -> exit
exit
done
    [dir] -> exit
[~] ->  

如何修復雙輸入?

ps 拱門、櫻花、st

答案1

取代bicon.bintry exec bicon.bin,可能使用參數將 shell 作為登入 shell 運行。

當您執行時,bicon.bin它會產生一個 shell,因此現在您擁有 (1) 原始 shell、(2)bicon.bin正在運作、以及 (3) 由 產生的 shell bicon.bin。原來exec的外殼被換掉了bicon.bin

答案2

首先要了解 bicon 是虛擬 shell,因此您需要退出兩次,一次從 bicon 退出,一次從 bash 退出。

因此,為了避免重複 .bashrc 命令,您必須將包含 bicon 的命令放在 .bashrc 的頂部。

另外,為了避免雙重退出,您可以執行以下操作:

alias exit='kill -9 $(ps -p $PPID -o ppid=)'

相關內容