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
0b0021ed
Commit
0b0021ed
authored
Jun 13, 2016
by
Dylan Araps
Committed by
GitHub
Jun 13, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #279 from dylanaraps/prompt
Dynamically set cursor position in image mode.
parents
c6c0b78d
43d4e1e8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
16 deletions
+4
-16
config
config/config
+0
-6
neofetch
neofetch
+4
-10
No files found.
config/config
View file @
0b0021ed
...
@@ -223,12 +223,6 @@ underline_enabled="on"
...
@@ -223,12 +223,6 @@ underline_enabled="on"
# --underline_char char
# --underline_char char
underline_char
=
"-"
underline_char
=
"-"
# Prompt height
# You should only have to change this if your
# prompt is greater than 2 lines high.
# --prompt_height num
prompt_height
=
1
# }}}
# }}}
...
...
neofetch
View file @
0b0021ed
...
@@ -248,12 +248,6 @@ underline_enabled="on"
...
@@ -248,12 +248,6 @@ underline_enabled="on"
# --underline_char char
# --underline_char char
underline_char
=
"-"
underline_char
=
"-"
# Prompt height
# You should only have to change this if your
# prompt is greater than 2 lines high.
# --prompt_height num
prompt_height
=
1
# }}}
# }}}
...
@@ -2991,8 +2985,6 @@ usage () { cat << EOF
...
@@ -2991,8 +2985,6 @@ usage () { cat << EOF
--underline_char char Character to use when underlining title
--underline_char char Character to use when underlining title
--line_wrap on/off Enable/Disable line wrapping
--line_wrap on/off Enable/Disable line wrapping
--bold on/off Enable/Disable bold text
--bold on/off Enable/Disable bold text
--prompt_height num Set this to your prompt height to fix issues with
the text going off screen at the top
Color Blocks:
Color Blocks:
...
@@ -3139,7 +3131,6 @@ while [ "$1" ]; do
...
@@ -3139,7 +3131,6 @@ while [ "$1" ]; do
--underline_char
)
underline_char
=
"
$2
"
;;
--underline_char
)
underline_char
=
"
$2
"
;;
--line_wrap
)
line_wrap
=
"
$2
"
;;
--line_wrap
)
line_wrap
=
"
$2
"
;;
--bold
)
bold
=
"
$2
"
;;
--bold
)
bold
=
"
$2
"
;;
--prompt_height
)
prompt_height
=
"
$2
"
;;
# Color Blocks
# Color Blocks
--color_blocks
)
color_blocks
=
"
$2
"
;;
--color_blocks
)
color_blocks
=
"
$2
"
;;
...
@@ -3353,10 +3344,13 @@ if [ "$image" != "off" ]; then
...
@@ -3353,10 +3344,13 @@ if [ "$image" != "off" ]; then
# Get cursor position
# Get cursor position
info_height
=
"
$(
stty
-echo
;
IFS
=
';'
read
-rdR
-t
1
-d
c
-p
$'
\0
33[6n
\0
33[c'
ROW COL
;
printf
"%s"
"
${
ROW
#*[
}
"
;
stty echo
)
"
info_height
=
"
$(
stty
-echo
;
IFS
=
';'
read
-rdR
-t
1
-d
c
-p
$'
\0
33[6n
\0
33[c'
ROW COL
;
printf
"%s"
"
${
ROW
#*[
}
"
;
stty echo
)
"
# Calculate image height in terminal cells.
lines
=
"
$((${
width
:-
1
}
/
${
font_width
:-
1
}
/
2
+
3
))
"
# Set cursor position dynamically based on height of ascii/text.
# Set cursor position dynamically based on height of ascii/text.
[
"
${
lines
:-
0
}
"
-lt
"
${
info_height
:-
0
}
"
]
&&
lines
=
"
$info_height
"
[
"
${
lines
:-
0
}
"
-lt
"
${
info_height
:-
0
}
"
]
&&
lines
=
"
$info_height
"
printf
"%b%s"
"
\0
33[
${
lines
}
H
\0
33[
${
prompt_height
}
A
"
printf
"%b%s"
"
\0
33[
${
lines
}
H"
fi
fi
# Re-enable line wrap
# Re-enable line wrap
...
...
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