mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-11-12 14:04:05 -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")"
|
PS2="$(::OMP:: print secondary --config="$POSH_THEME" --shell=bash --shell-version="$BASH_VERSION")"
|
||||||
|
|
||||||
function _set_posh_cursor_position() {
|
function _set_posh_cursor_position() {
|
||||||
echo -ne "\033[6n" # ask the terminal for the position
|
# not supported in Midnight Commander
|
||||||
read -s -d\[ garbage # discard the first part of the response
|
# see https://github.com/JanDeDobbeleer/oh-my-posh/issues/3415
|
||||||
read -s -d R pos # store the position in bash variable 'pos'
|
if [[ -v MC_SID ]];then
|
||||||
export POSH_CURSOR_LINE=${pos%;*}
|
return
|
||||||
export POSH_CURSOR_COLUMN=${pos#*;}
|
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() {
|
function _omp_start_timer() {
|
||||||
|
|
|
@ -8,6 +8,11 @@ export POSH_PROMPT_COUNT=0
|
||||||
PS2="$(::OMP:: print secondary --config="$POSH_THEME" --shell=zsh)"
|
PS2="$(::OMP:: print secondary --config="$POSH_THEME" --shell=zsh)"
|
||||||
|
|
||||||
function _set_posh_cursor_position() {
|
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
|
echo -ne "\033[6n" # ask the terminal for the position
|
||||||
read -s -d\[ garbage # discard the first part of the response
|
read -s -d\[ garbage # discard the first part of the response
|
||||||
read -s -d R pos # store the position in bash variable 'pos'
|
read -s -d R pos # store the position in bash variable 'pos'
|
||||||
|
|
Loading…
Reference in a new issue