mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-28 20:39:40 -08:00
parent
2839cd3468
commit
a0931f84a4
|
@ -10,11 +10,16 @@ PS0='${omp_start_time:0:$((omp_start_time="$(_omp_start_timer)",0))}'
|
|||
PS2="$(::OMP:: print secondary --config="$POSH_THEME" --shell=bash --shell-version="$BASH_VERSION")"
|
||||
|
||||
function _set_posh_cursor_position() {
|
||||
echo -ne "\033[6n" # ask the terminal for the position
|
||||
read -s -d\[ garbage # discard the first part of the response
|
||||
read -s -d R pos # store the position in bash variable 'pos'
|
||||
export POSH_CURSOR_LINE=${pos%;*}
|
||||
export POSH_CURSOR_COLUMN=${pos#*;}
|
||||
# not supported in Midnight Commander
|
||||
# see https://github.com/JanDeDobbeleer/oh-my-posh/issues/3415
|
||||
if [[ -v MC_SID ]];then
|
||||
return
|
||||
fi
|
||||
echo -ne "\033[6n" # ask the terminal for the position
|
||||
read -s -d\[ garbage # discard the first part of the response
|
||||
read -s -d R pos # store the position in bash variable 'pos'
|
||||
export POSH_CURSOR_LINE=${pos%;*}
|
||||
export POSH_CURSOR_COLUMN=${pos#*;}
|
||||
}
|
||||
|
||||
function _omp_start_timer() {
|
||||
|
|
|
@ -8,6 +8,11 @@ export POSH_PROMPT_COUNT=0
|
|||
PS2="$(::OMP:: print secondary --config="$POSH_THEME" --shell=zsh)"
|
||||
|
||||
function _set_posh_cursor_position() {
|
||||
# not supported in Midnight Commander
|
||||
# see https://github.com/JanDeDobbeleer/oh-my-posh/issues/3415
|
||||
if [[ -v MC_SID ]];then
|
||||
return
|
||||
fi
|
||||
echo -ne "\033[6n" # ask the terminal for the position
|
||||
read -s -d\[ garbage # discard the first part of the response
|
||||
read -s -d R pos # store the position in bash variable 'pos'
|
||||
|
|
Loading…
Reference in a new issue