1. get_position bug in Mac OS
- Posted by bryanso Nov 22, 2012
- 887 views
I think this piece of code demonstrates a bug in get_position in Mac OS Mountain Lion. EU 4.0.5.
include std/graphics.e include std/get.e global procedure get_position_bug() object config = video_config() object pos atom c = 0 while c != 'q' do pos = get_position() printf(1, " %d %d %d %d", {config[3], config[4], pos[1], pos[2]}) c = wait_key() puts(1, "\n") end while end procedure clear_screen() get_position_bug()
This is run in a standard Terminal window with 24 rows by 80 columns. Keep pressing any key. At the very bottom line, the screen has not scrolled yet. The last is printed on row 24, but the position returned by get_position is always 23:
24 80 1 1 24 80 2 1 24 80 3 1 24 80 4 1 24 80 5 1 24 80 6 1 24 80 7 1 24 80 8 1 24 80 9 1 24 80 10 1 24 80 11 1 24 80 12 1 24 80 13 1 24 80 14 1 24 80 15 1 24 80 16 1 24 80 17 1 24 80 18 1 24 80 19 1 24 80 20 1 24 80 21 1 24 80 22 1 24 80 23 1 24 80 23 1