Closed akkartik closed 9 years ago
Thanks for your example, however, it displays Hello at 5,5 for me.
The only example I can get for Hello to show at 5,1 is
#lang racket
(require (planet neil/charterm:3:1))
(require terminal-color)
(open-charterm)
(charterm-clear-screen)
(charterm-cursor 5 5)
(display-color "Hello" #:fg 'green) ; shows at 5,1
(charterm-newline)
(close-charterm)
which was fixed by using
#lang racket
(require (planet neil/charterm:3:1))
(require terminal-color)
(open-charterm)
(charterm-clear-screen)
(charterm-cursor 5 5)
(display-color "Hello" #:fg 'green) ; shows at 5,5
(flush-output) ; note this call
(charterm-newline)
(close-charterm)
Can you see if this works for you?
Regarding mixing the 2 libraries I believe for full support (positioning + color) it's only possible to do this on unix-like systems with a terminal that supports ANSI escape codes.
Many thanks for the tips!
Yes, (flush-output)
does the trick. Thanks again.
Obviously not a bug per se. More a plea for help from someone who understands terminal internals.
I'm on Ubuntu 14.04 (gnome-terminal;
TERM=xterm
). I'm trying to use http://www.neilvandyke.org/racket-charterm to move the cursor around, etc. andterminal-color
to print in color after moving around. It seems to work just enough to keep me interested. For example (afterrequire
ing charterm and terminal-color):This works great. The screen shows "Hello" at 5,5 on the screen. However, replacing the
displayln-color
withdisplay-color
causes the text to appear at row 5, col 1. Usingcharterm-newline
orcharterm-clear-line
sometimes gives me the sense that display doesn't immediately update the screen. Do you have any idea what might be going on? Is combining these two libraries just a bad idea because of incompatible internals or something? Thanks.