mirror of
https://github.com/mjsarfatti/beddu.git
synced 2025-06-26 17:08:01 +02:00
Fix flashing cursor
This commit is contained in:
parent
4334716ff3
commit
5eed38d418
3 changed files with 16 additions and 17 deletions
2
Makefile
2
Makefile
|
@ -39,7 +39,7 @@ release:
|
||||||
sed -i '' "s/# Version: .*/# Version: $$VERSION/" $(OUTPUT); \
|
sed -i '' "s/# Version: .*/# Version: $$VERSION/" $(OUTPUT); \
|
||||||
git add $(OUTPUT); \
|
git add $(OUTPUT); \
|
||||||
git commit -m "Release $$VERSION"; \
|
git commit -m "Release $$VERSION"; \
|
||||||
git tag -a "$$VERSION" -m "Release $$VERSION"
|
git tag -a "$$VERSION" -m "Release $$VERSION"; \
|
||||||
@echo "\nRelease complete: \033[32m$$VERSION\033[0m"
|
@echo "\nRelease complete: \033[32m$$VERSION\033[0m"
|
||||||
|
|
||||||
%:
|
%:
|
||||||
|
|
18
demo/demo.sh
18
demo/demo.sh
|
@ -1,15 +1,13 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Import the beddu.sh library
|
|
||||||
# shellcheck disable=SC1091
|
# shellcheck disable=SC1091
|
||||||
source "$(dirname -- "$0")/../build/beddu.sh"
|
source "$(dirname -- "$0")/../dist/beddu.sh"
|
||||||
|
|
||||||
# Demo function to showcase the framework
|
|
||||||
demo() {
|
demo() {
|
||||||
_violet=99
|
_violet=99
|
||||||
_pink=219
|
_pink=219
|
||||||
|
|
||||||
pen "\n>> $_q <<\n"
|
hide_cursor
|
||||||
|
|
||||||
line
|
line
|
||||||
pen $_violet "╔═════════════════════════════════════════════╗"
|
pen $_violet "╔═════════════════════════════════════════════╗"
|
||||||
|
@ -27,7 +25,7 @@ demo() {
|
||||||
line
|
line
|
||||||
spin $_pink "Loading text formatting..."
|
spin $_pink "Loading text formatting..."
|
||||||
sleep 1
|
sleep 1
|
||||||
spop
|
spop --keep-cursor-hidden
|
||||||
upclear
|
upclear
|
||||||
pen $_pink italic "-- Text formatting --"
|
pen $_pink italic "-- Text formatting --"
|
||||||
line
|
line
|
||||||
|
@ -39,7 +37,7 @@ demo() {
|
||||||
line
|
line
|
||||||
spin $_pink "Loading basic colors..."
|
spin $_pink "Loading basic colors..."
|
||||||
sleep 1
|
sleep 1
|
||||||
spop
|
spop --keep-cursor-hidden
|
||||||
upclear
|
upclear
|
||||||
pen $_pink italic "-- Basic colors --"
|
pen $_pink italic "-- Basic colors --"
|
||||||
line
|
line
|
||||||
|
@ -58,7 +56,7 @@ demo() {
|
||||||
line
|
line
|
||||||
spin $_pink "Loading ANSI 256 colors..."
|
spin $_pink "Loading ANSI 256 colors..."
|
||||||
sleep 1
|
sleep 1
|
||||||
spop
|
spop --keep-cursor-hidden
|
||||||
upclear
|
upclear
|
||||||
pen $_pink italic "-- ANSI 256 colors (examples) --"
|
pen $_pink italic "-- ANSI 256 colors (examples) --"
|
||||||
line
|
line
|
||||||
|
@ -70,7 +68,7 @@ demo() {
|
||||||
line
|
line
|
||||||
spin $_pink "Loading combined formatting..."
|
spin $_pink "Loading combined formatting..."
|
||||||
sleep 1
|
sleep 1
|
||||||
spop
|
spop --keep-cursor-hidden
|
||||||
upclear
|
upclear
|
||||||
pen $_pink italic "-- Combined formatting --"
|
pen $_pink italic "-- Combined formatting --"
|
||||||
line
|
line
|
||||||
|
@ -88,7 +86,7 @@ demo() {
|
||||||
line
|
line
|
||||||
spin $_pink "Loading output utilities..."
|
spin $_pink "Loading output utilities..."
|
||||||
sleep 1
|
sleep 1
|
||||||
spop
|
spop --keep-cursor-hidden
|
||||||
upclear
|
upclear
|
||||||
pen $_pink italic "-- Output utilities --"
|
pen $_pink italic "-- Output utilities --"
|
||||||
line
|
line
|
||||||
|
@ -99,7 +97,7 @@ demo() {
|
||||||
line
|
line
|
||||||
spin $_pink "Starting interactive experience..."
|
spin $_pink "Starting interactive experience..."
|
||||||
sleep 1
|
sleep 1
|
||||||
spop
|
spop --keep-cursor-hidden
|
||||||
upclear
|
upclear
|
||||||
pen $_pink italic "-- Interactive functions --"
|
pen $_pink italic "-- Interactive functions --"
|
||||||
line
|
line
|
||||||
|
|
|
@ -46,7 +46,7 @@ spin() {
|
||||||
hide_cursor
|
hide_cursor
|
||||||
|
|
||||||
# Use a trap to catch USR1 signal for clean shutdown
|
# Use a trap to catch USR1 signal for clean shutdown
|
||||||
trap "show_cursor; exit 0" USR1
|
trap "exit 0" USR1
|
||||||
|
|
||||||
# Print the first frame of the spinner
|
# Print the first frame of the spinner
|
||||||
pen -n cyan "${spinner:0:1} "
|
pen -n cyan "${spinner:0:1} "
|
||||||
|
@ -82,11 +82,12 @@ spop() {
|
||||||
# Ensure it's really gone
|
# Ensure it's really gone
|
||||||
if ps -p "${_spinner_pid}" >/dev/null 2>&1; then
|
if ps -p "${_spinner_pid}" >/dev/null 2>&1; then
|
||||||
kill "${_spinner_pid}" 2>/dev/null
|
kill "${_spinner_pid}" 2>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
# Manually clean up display, unless asked not to do so
|
# Manually clean up display, unless asked not to do so
|
||||||
if [[ "$keep_cursor_hidden" == false ]]; then
|
if [[ "$keep_cursor_hidden" == false ]]; then
|
||||||
show_cursor
|
show_cursor
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
_spinner_pid=""
|
_spinner_pid=""
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue