Compare commits
1 Commits
fff22c22d7
...
63b7170ccb
Author | SHA1 | Date | |
---|---|---|---|
63b7170ccb |
@ -132,16 +132,14 @@ fresh_line_one() {
|
||||
|
||||
# Executed before each prompt.
|
||||
fresh_almostontop_precmd() {
|
||||
# TODO: store the cursor position for use in fresh_almostontop_preexec
|
||||
# CSI ESC[6n gets the cursor position in the form ESC[<row>;<column>R
|
||||
printf "\033[6n"
|
||||
# Discard prefix delimited by [
|
||||
read -s -d [
|
||||
# Store the <row> delimited by ; in fresh_precmd_row
|
||||
read -s -d \; fresh_precmd_row
|
||||
# Store the <row> delimited by ; in row_before
|
||||
read -s -d \; row_before
|
||||
# Discard suffix delimted by R otherwise it is output to the tty
|
||||
read -s -d R
|
||||
# printf "$fresh_precmd_row\n"
|
||||
}
|
||||
|
||||
# Executed just after a command has been read and is about to be executed.
|
||||
@ -159,7 +157,7 @@ fresh_almostontop_preexec() {
|
||||
let "down = $LINES - $row"
|
||||
printf "\033[${down}B"
|
||||
# Calculate the number of lines in the prompt
|
||||
let "prompt_lines = ($row - $fresh_precmd_row) + 2"
|
||||
let "prompt_lines = ($row - $row_before) + 2"
|
||||
# Print new lines to push the old command out of view
|
||||
let "new = $row - $prompt_lines"
|
||||
for (( i = 0; i < $new; i++ )); do
|
||||
|
Loading…
x
Reference in New Issue
Block a user