view console/libgnt/gntkeys.c @ 14900:065e7ac30338

[gaim-migrate @ 17672] Rearranging a bunch of stuff. Users shouldn't notice any change, apart from the added ability to bind keys for the window-manager. I will update the manual in a while. I need to know how to revert a commit in case things go terribly wrong. ... I am going to remind everyone that Dido is AWESOME! committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sun, 05 Nov 2006 17:28:33 +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';
	}
}