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
b4e5169a
Commit
b4e5169a
authored
Jan 31, 2017
by
Dylan Araps
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
General: Simplified prompt calculation, un-hardcoded line breaks. Closes #652
parent
8fb4aec1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
14 deletions
+8
-14
neofetch
neofetch
+8
-14
No files found.
neofetch
View file @
b4e5169a
...
...
@@ -2625,6 +2625,7 @@ get_line_break() {
# Calculate info height.
((++info_height))
line_breaks+=$'
\n
'
# Tell info() that we printed manually.
prin=1
...
...
@@ -3497,34 +3498,27 @@ get_term_padding() {
dynamic_prompt() {
case "
$image_backend
" in
"
ascii
") ;;
"
ascii
")
printf "
\n
"
;;
"
off
") return ;;
*)
get_term_padding 2>/dev/null
# Calculate image height in terminal cells.
lines="
$((
(
border
*
2
+
height
+
yoffset
)
/
font_height
))
"
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
# based on the info height instead of the ascii/image height.
if ((lines < info_height)); then
printf "
\n
"
[[ "
$image_prompt
" ]] &&
printf "
\n
"
return
else
[[ "
$image_prompt
" ]] && printf "
%b
\n
" "
$line_breaks
"
lines="
$((
lines
-
info_height
))
"
fi
# Set the prompt location.
if ((lines < 0)); then
printf "
%b
" "
\0
33[
${
lines
/-
}
A
"
else
printf "
%b
" "
\0
33[
${
lines
}
B
"
fi
# Add some padding.
printf "
\n\n\n\n
"
((lines > 0)) && printf "
%b
" "
\0
33[
${
lines
}
B
"
}
old_functions() {
...
...
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