Пропускать fsck при загрузке

Вот что я в конце концов написал.

# this variable can be changed later to change the fraction of the line 
export PROMPT_PERCENT_OF_LINE=20

# make a function, so that it can be evaluated repeatedly
function myPromptWidth() { 
  echo $(( ${COLUMNS:-80} * PROMPT_PERCENT_OF_LINE / 100 )) 
}

# for some reason you can't put a function right in PROMPT, so make an
# intermediary variable
width_part='$(myPromptWidth)'

# use ${} to evaluate the variable containing function
PROMPT="%F{106}%${width_part}<…<%3~%f%(?..%{$fg[red]%} %?%{$reset_color%})%(1j.%{$fg[cyan]%} %j%{$reset_color%}.)%# "

Это приведет к пересчету ширины сразу после изменения размера терминала.

1
03.04.2016, 03:19
0 ответов

Теги

Похожие вопросы