blob: a782061fddde44064d54aeabfc60c5838ee25353 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001/*
2 * An extremely simple program to make the cursor blink in an xterm.
3 * This is useful when the cursor is hard to spot in a highlighted file.
4 * Start in the background: "blink&" Stop by killing it.
5 * Bram Moolenaar 980109 (based on an idea from John Lange).
6 */
7
8#include <stdio.h>
Bram Moolenaarc95a3022016-06-12 23:01:46 +02009#include <unistd.h>
Bram Moolenaar071d4272004-06-13 20:20:40 +000010
Bram Moolenaard14e00e2016-01-31 17:30:51 +010011 int
Bram Moolenaarc95a3022016-06-12 23:01:46 +020012main(void)
Bram Moolenaar071d4272004-06-13 20:20:40 +000013{
14 while (1)
15 {
16 printf("\e[?25h");
17 fflush(stdout);
18 usleep(400000); /* on time */
19 printf("\e[?25l");
20 fflush(stdout);
21 usleep(250000); /* off time */
22 }
Bram Moolenaard14e00e2016-01-31 17:30:51 +010023 return 0;
Bram Moolenaar071d4272004-06-13 20:20:40 +000024}