[英]How do you change fish pwd length in prompt using fish_prompt_pwd_dir_length?
[英]How to time fish prompt
我正在考慮從 zsh 切換到 fish,但是在我這樣做之前,我想比較提示加載的速度。 我有一個 ZSH function,它的時間是提示加載所需時間的 10 倍。
timeshell() {
shell=${1-$SHELL}
for i in $(seq 1 10); do /usr/bin/time $shell -i -c exit; done
}
我正在努力將相同的代碼實現為符合魚類標准的代碼。 例如以下內容:
time for i in 1 2 3 4 5 6 7 8 9 10; fish; end
將實際加載魚 shell 提示,取消命令。
有什么想法嗎? 謝謝你。
在 fish 中,您可以計時 function:
> time fish_prompt
Executed in 6.71 ms fish external
usr time 1.72 ms 0.00 ms 1.72 ms
sys time 6.07 ms 6.07 ms 0.00 ms
不確定我是否完全理解。 你是這個意思嗎?
function timeshell
set shell $SHELL
for i in (seq 1 10); /usr/bin/time $shell -i -c exit; end
end
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.