Only complaint now is that when the question is asked at the very bottom of the window the cursor still jumps to the next line, the window scrolls but the cursor jumps back to the end of the question. If askYesOrNo 'Do you wish to continue?' then Printf '\e\e[0m ' # print $1 in colorĮlif thenįor (( i = 100, max = 110 i <= max i++ )) do What about those code in man console_codes? Can't those be used to program in a reasonably safe / portable way in Bash?
All I want is to keep the cursor in place until an acceptable answer arrives. Fortunately I don't need to resize the terminal. Yes, probably quite a few of these escape codes won't work everywhere. IF and a big if, it doesn't work then many of those terminal commands in the URLs won't work either.Īrray.
Of course calling it again with 24 and 80 restores it back to the original. Code : Last login: Tue Feb 4 16:17:10 on ttys000ĪMIGA:amiga~> printf '%b\n' '$'Īs for the second 'printf' line, changing the values 24 and 80 to say 30 and 120 will expand the terminal size on certain terminals, (xterm as an exmaple), to that size for the duration of that terminal session.