Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm
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
Vladislav
eepm
Commits
7eb9a361
Commit
7eb9a361
authored
Apr 10, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eget: update tty functions
parent
47d0f713
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
8 deletions
+16
-8
tools_eget
bin/tools_eget
+16
-8
No files found.
bin/tools_eget
View file @
7eb9a361
...
...
@@ -52,33 +52,41 @@ isatty2()
check_tty
()
{
isatty
||
return
which
tput
>
/dev/null 2>/dev/null
||
return
is_command
tput
>
/dev/null 2>/dev/null
||
return
# FreeBSD does not support tput -S
echo
| tput
-S
>
/dev/null 2>/dev/null
||
return
[
-z
"
$USETTY
"
]
||
return
export
USETTY
=
1
echo
|
a
=
tput
-S
>
/dev/null 2>/dev/null
||
return
export
USETTY
=
"tput -S"
}
:
${
BLACK
:
=0
}
${
RED
:
=1
}
${
GREEN
:
=2
}
${
YELLOW
:
=3
}
${
BLUE
:
=4
}
${
MAGENTA
:
=5
}
${
CYAN
:
=6
}
${
WHITE
:
=7
}
set_boldcolor
()
{
[
"
$USETTY
"
=
"1
"
]
||
return
[
-n
"
$USETTY
"
]
||
return
{
echo
bold
echo
setaf
$1
}
|tput
-S
}
|
$USETTY
}
set_color
()
{
[
-n
"
$USETTY
"
]
||
return
{
echo
setaf
$1
}
|
$USETTY
}
restore_color
()
{
[
"
$USETTY
"
=
"1
"
]
||
return
[
-n
"
$USETTY
"
]
||
return
{
echo
op
;
# set Original color Pair.
echo
sgr0
;
# turn off all special graphics mode (bold in our case).
}
|
tput
-S
}
|
$USETTY
}
echover
()
{
[
-n
"
$verbose
"
]
||
return
...
...
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