view console/libgnt/gntkeys.c @ 14956:0b98802a97cf

[gaim-migrate @ 17735] (09:35:51) Alver: http://studwww.ugent.be/~lvalboom/zephyr.patch (09:36:03) LSchiere2: how many do you have? (09:36:14) Alver: That's all so far committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Fri, 10 Nov 2006 14:38:08 +0000
parents c01f62c83647
children 99112cd4a2f4
line wrap: on
line source

#include "gntkeys.h"

#include <stdlib.h>
#include <string.h>

const char *term;

void gnt_keys_refine(char *text)
{
	if (*text == 27 && *(text + 1) == '[' && *(text + 3) == '\0' &&
			(*(text + 2) >= 'A' || *(text + 2) <= 'D')) {
		if (term == NULL)
			term = getenv("TERM");
		/* Apparently this is necessary for urxvt and screen */
		if (strcmp(term, "screen") == 0 || strcmp(term, "rxvt-unicode") == 0)
			*(text + 1) = 'O';
	}
}