64-bit time_t hides the blinking cursor when I type
Submitted by Kalle Olavi Niemitalo
Link to original bug (#109541)
Description
Please see http://bugs.debian.org/186764 for some extra details.
To repeat:
Start up gnome-terminal (which Debian configures to use vte) and check that the current profile has the blinking cursor enabled. Type a command such as "apt-get ionstall python2.2". Notice the typo and press the left arrow key until the cursor is at it.
Expected behavior:
The cursor should become visible when it moves, so that I immediately know where it is. This is how it works on i386.
Actual behavior:
On Alpha, when I press the arrow key, gnome-terminal actually hides the cursor. To see whether I have moved the cursor far enough, I need to wait a moment so that the cursor becomes visible again.
Workaround:
Disable the blinking cursor in the profile; then the cursor stays visible all the time.
Reason:
When I press a key, vte_terminal_key_press() converts the current time to milliseconds and saves it in a variable (guint last_keypress_time). When vte needs to redraw the cursor, vte_terminal_get_blink_state() again converts the current time to milliseconds, saves it in a variable (time_t daytime) and then computes their difference modulo blink_cycle. When only little time has passed after the keypress, the difference should be near zero, and the cursor should be visible.
On the Alpha however, guint is 32-bit but time_t is 64-bit. Thus last_keypress_time overflows (32 bits can only hold 49.7 days worth of milliseconds) but daytime doesn't. This messes up the comparison.
Fix:
I have made a patch and tested that it helps on the Alpha. It seems I can't attach it to this report right now, so I'll do that separately.
Version: 0.11.x
Resolution: RESOLVED OBSOLETE