Skip to content

Commit fa78ecb

Browse files
authored
Update mysqlmonitor.sh
1 parent ad5c657 commit fa78ecb

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

mysqlmonitor.sh

+10-4
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
TITLE="------------------------------- MySQL Monitor (Press 'q' to exit) -------------------"
1010

1111
# Define minimum terminal size requirements
12-
MIN_COLS=88 # Minimum number of columns
13-
MIN_ROWS=50 # Minimum number of rows
12+
MIN_COLS=50 # Minimum number of columns
13+
MIN_ROWS=45 # Minimum number of rows
1414

1515
# Check for required tools
1616
for tool in mysqladmin awk; do
@@ -73,8 +73,10 @@ tput smcup 2>/dev/null || true
7373

7474
# Handle CTRL+C and other term signals to restore screen and cursor before exit.
7575
cleanup() {
76-
printf '\033[?25h' # Show the cursor
77-
tput rmcup 2>/dev/null || true
76+
# Re-enable line wrapping
77+
printf "\033[?7h"
78+
printf '\033[?25h'
79+
tput rmcup 2>/dev/null || true
7880
echo -e "\nExiting MySQL Monitor. Goodbye!"
7981
exit
8082
}
@@ -87,6 +89,10 @@ printf '\033[?25l'
8789
# Clear the screen once before starting the loop
8890
printf "\033[H\033[J"
8991

92+
# ---------------- NEW: Disable wrapping here ----------------
93+
printf "\033[?7l"
94+
# -----------------------------------------------------------
95+
9096
while true; do
9197

9298
# Read current terminal size

0 commit comments

Comments
 (0)