Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
neofetch
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
neofetch
Commits
dfc8b10e
Commit
dfc8b10e
authored
May 24, 2018
by
Dylan Araps
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
general: Fix cursor location errors.
parent
38762182
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
41 deletions
+12
-41
neofetch
neofetch
+12
-41
No files found.
neofetch
View file @
dfc8b10e
...
@@ -3352,9 +3352,9 @@ get_cols() {
...
@@ -3352,9 +3352,9 @@ get_cols() {
cols="${cols//nl/\\n\\e[${text_padding}C${zws}}"
cols="${cols//nl/\\n\\e[${text_padding}C${zws}}"
# Add block height to info height.
# Add block height to info height.
((info_height+=block_height
+2
))
((info_height+=block_height
-1
))
printf "%b
\n
" "\e[${text_padding}C${zws}${cols}"
printf "%b" "\e[${text_padding}C${zws}${cols}"
fi
fi
unset -v blocks blocks2 cols
unset -v blocks blocks2 cols
...
@@ -3362,7 +3362,7 @@ get_cols() {
...
@@ -3362,7 +3362,7 @@ get_cols() {
# TosWin2 on FreeMiNT is terrible at this,
# TosWin2 on FreeMiNT is terrible at this,
# so we'll reset colors arbitrarily.
# so we'll reset colors arbitrarily.
[[ "$term" == "TosWin2" ]] && \
[[ "$term" == "TosWin2" ]] && \
printf "%b
\n
" "\e[30;47m"
printf "%b" "\e[30;47m"
# Tell info() that we printed manually.
# Tell info() that we printed manually.
prin=1
prin=1
...
@@ -3943,6 +3943,8 @@ get_underline() {
...
@@ -3943,6 +3943,8 @@ get_underline() {
"${underline// /$underline_char}${reset} "
"${underline// /$underline_char}${reset} "
unset -v length
unset -v length
fi
fi
((++info_height))
prin=1
prin=1
}
}
...
@@ -3952,7 +3954,6 @@ get_line_break() {
...
@@ -3952,7 +3954,6 @@ get_line_break() {
# Calculate info height.
# Calculate info height.
((++info_height))
((++info_height))
line_breaks+="\n"
# Tell info() that we printed manually.
# Tell info() that we printed manually.
prin=1
prin=1
...
@@ -4189,49 +4190,19 @@ kde_config_dir() {
...
@@ -4189,49 +4190,19 @@ kde_config_dir() {
kde_config_dir="${kde_config_dir/$'/:'*}"
kde_config_dir="${kde_config_dir/$'/:'*}"
}
}
get_term_padding() {
# Terminal info.
#
# Parse terminal config files to get
# info about padding. Due to how w3m-img
# works padding around the terminal throws
# off the cursor placement calculation in
# specific terminals.
#
# Note: This issue only seems to affect
# URxvt.
((term_run != 1)) && get_term
case "$term" in
"URxvt"*)
border="$(xrdb -query | awk -F ':' '/^(URxvt|\*).internalBorder/ {printf $2; exit}')"
;;
esac
}
dynamic_prompt() {
dynamic_prompt() {
case "$image_backend" in
[[ "$image_backend" == "off" ]] && { printf "\n"; return; }
"ascii") printf "\n" ;;
[[ "$image_backend" != "ascii" ]] && ((lines+=1000))
"off") return ;;
*)
get_term_padding
lines="$(((border + height + yoffset) / font_height))"
image_prompt="on"
;;
esac
# If the info is higher than the ascii/image place the prompt
# If the ascii art is taller than the info.
# based on the info height instead of the ascii/image height.
if ((lines > info_height)); then
if ((lines < info_height)); then
[[ "$image_prompt" ]] && printf "\n"
return
else
[[ "$image_prompt" ]] && printf "%b\n" "$line_breaks"
lines="$((lines - info_height + 1))"
lines="$((lines - info_height + 1))"
else
lines=1
fi
fi
# Set the prompt location.
# Set the prompt location.
if ((lines > 1)); then
if ((lines >
=
1)); then
case "$kernel_name" in
case "$kernel_name" in
"OpenBSD") tput cud "$lines" ;;
"OpenBSD") tput cud "$lines" ;;
*) printf "%b" "\e[${lines}B" ;;
*) printf "%b" "\e[${lines}B" ;;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment