>From 310fb8be047e89534ecbf9b94ee8fda9e4458053 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski?= Date: Sat, 6 Oct 2012 14:33:19 +0200 Subject: [PATCH 1/2] Allow screen to run on terminals with long $TERM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit According to tic man page: Terminal names exceeding the maximum alias length (32 characters on systems with long filenames, 14 characters otherwise) will be truncated to the maximum alias length and a warning message will be printed. Signed-off-by: Amadeusz Sławiński diff --git a/src/display.h b/src/display.h index e48741f..19dded7 100644 --- a/src/display.h +++ b/src/display.h @@ -73,7 +73,7 @@ struct display struct win *d_other; /* pointer to other window */ int d_nonblock; /* -1 don't block if obufmax reached */ /* >0: block after nonblock secs */ - char d_termname[20 + 1]; /* $TERM */ + char d_termname[MAXTERMLEN + 1]; /* $TERM */ char *d_tentry; /* buffer for tgetstr */ char d_tcinited; /* termcap inited flag */ int d_width, d_height; /* width/height of the screen */ diff --git a/src/os.h b/src/os.h index 5c17c83..f1d849c 100644 --- a/src/os.h +++ b/src/os.h @@ -45,6 +45,14 @@ #define NAME_MAX 14 #endif +#if !defined(MAXTERMLEN) +# if !defined(HAVE_LONG_FILE_NAMES) +# define MAXTERMLEN 14 +# else +# define MAXTERMLEN 32 +# endif +#endif + #ifdef ISC # ifdef ENAMETOOLONG # undef ENAMETOOLONG diff --git a/src/screen.h b/src/screen.h index 5c93f32..c7d38a3 100644 --- a/src/screen.h +++ b/src/screen.h @@ -182,8 +182,9 @@ struct mode * A few revisions after 8147d08 incorrectly * carried version 1, but should have carried 2. * 2: screen version 4.1.0devel (revisions 8b46d8a upto YYYYYYY) + * 3: screen version 4.1.0devel */ -#define MSG_VERSION 2 +#define MSG_VERSION 3 #define MSG_REVISION (('m'<<24) | ('s'<<16) | ('g'<<8) | MSG_VERSION) struct msg @@ -214,7 +215,7 @@ struct msg char preselect[20]; int esc; /* his new escape character unless -1 */ int meta_esc; /* his new meta esc character unless -1 */ - char envterm[20 + 1]; /* terminal type */ + char envterm[MAXTERMLEN + 1]; /* terminal type */ int encoding; /* encoding of display */ int detachfirst; /* whether to detach remote sessions first */ } -- 1.7.12