view runtime/tools/blink.c @ 18430:0388e1991ec5 v8.1.2209

patch 8.1.2209: LF in escape codes may be expanded to CR-LF Commit: https://github.com/vim/vim/commit/ec6f7350129f8c7809fd061f58a9eb6790c445a8 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Oct 24 17:49:27 2019 +0200 patch 8.1.2209: LF in escape codes may be expanded to CR-LF Problem: LF in escape codes may be expanded to CR-LF. Solution: Do not expand LF in escape codes to CR-LF. (closes https://github.com/vim/vim/issues/5107)
author Bram Moolenaar <Bram@vim.org>
date Thu, 24 Oct 2019 18:00:04 +0200
parents 64035abb986b
children
line wrap: on
line source

/*
 * An extremely simple program to make the cursor blink in an xterm.
 * This is useful when the cursor is hard to spot in a highlighted file.
 * Start in the background: "blink&"  Stop by killing it.
 * Bram Moolenaar  980109  (based on an idea from John Lange).
 */

#include <stdio.h>
#include <unistd.h>

	int
main(void)
{
	while (1)
	{
		printf("\e[?25h");
		fflush(stdout);
		usleep(400000);		/* on time */
		printf("\e[?25l");
		fflush(stdout);
		usleep(250000);		/* off time */
	}
	return 0;
}