
$status
물고기 껍질에 프롬프트를 추가하려고 했지만 항상 0이 인쇄됩니다.
이 질문은 얼마 전 irc에 올라왔는데 여기에 답변이 없어서 놀랐기 때문에 여기에도 게시해야겠다고 생각했습니다.
답변1
이는 프롬프트 내에서 호출하는 모든 함수/명령이 값을 재설정하기 때문입니다. 작동하게 하려면 fish_prompt 또는 fish_right_prompt 함수에서 가장 먼저 수행하는 작업으로 다른 변수에 값을 할당하십시오.
function fish_prompt --description 'Write out the prompt'
set -l _display_status $status
...
printf '%s' $_display_status
end