mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-03 16:46:18 +00:00 
			
		
		
		
	In yet another triumph of stupidity over common sense, the glibc
sys/ttydefaults.h is just a copy of the file from *BSD, taking no account of the fact that their OWN termios.h uses entirely different indexes into the array. I know ttydefaults.h is not meant to be portable, but you'd think it would be obvious to anyone that no file is better than a broken one...
This commit is contained in:
		@@ -1,4 +1,4 @@
 | 
			
		||||
/* $Id: cmd-new-session.c,v 1.56 2009-08-19 14:32:49 nicm Exp $ */
 | 
			
		||||
/* $Id: cmd-new-session.c,v 1.57 2009-08-19 15:57:54 nicm Exp $ */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
 | 
			
		||||
@@ -207,8 +207,28 @@ cmd_new_session_exec(struct cmd *self, struct cmd_ctx *ctx)
 | 
			
		||||
	if (ctx->cmdclient != NULL && ctx->cmdclient->tty.fd != -1) {
 | 
			
		||||
		if (tcgetattr(ctx->cmdclient->tty.fd, &tio) != 0)
 | 
			
		||||
			fatal("tcgetattr failed");
 | 
			
		||||
	} else
 | 
			
		||||
	} else {
 | 
			
		||||
#ifdef HAVE_TTYDEFCHARS
 | 
			
		||||
		memcpy(tio.c_cc, ttydefchars, sizeof tio.c_cc);
 | 
			
		||||
#else
 | 
			
		||||
		memset(tio.c_cc, _POSIX_VDISABLE, sizeof tio.c_cc);
 | 
			
		||||
		tio.c_cc[VINTR] = CINTR;
 | 
			
		||||
		tio.c_cc[VQUIT] = CQUIT;
 | 
			
		||||
		tio.c_cc[VERASE] = CERASE;
 | 
			
		||||
		tio.c_cc[VKILL] = CKILL;
 | 
			
		||||
		tio.c_cc[VEOF] = CEOF;
 | 
			
		||||
		tio.c_cc[VTIME] = CTIME;
 | 
			
		||||
		tio.c_cc[VMIN] = CMIN;
 | 
			
		||||
		tio.c_cc[VSTART] = CSTART;
 | 
			
		||||
		tio.c_cc[VSTOP] = CSTOP;
 | 
			
		||||
		tio.c_cc[VSUSP] = CSUSP;
 | 
			
		||||
		tio.c_cc[VEOL] = CEOL;
 | 
			
		||||
		tio.c_cc[VREPRINT] = CREPRINT;
 | 
			
		||||
		tio.c_cc[VDISCARD] = CDISCARD;
 | 
			
		||||
		tio.c_cc[VWERASE] = CWERASE;
 | 
			
		||||
		tio.c_cc[VLNEXT] = CLNEXT;
 | 
			
		||||
#endif
 | 
			
		||||
	}
 | 
			
		||||
	tio.c_iflag = TTYDEF_IFLAG;
 | 
			
		||||
	tio.c_oflag = TTYDEF_OFLAG;
 | 
			
		||||
	tio.c_lflag = TTYDEF_LFLAG;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										7
									
								
								configure
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										7
									
								
								configure
									
									
									
									
										vendored
									
									
								
							@@ -1,5 +1,5 @@
 | 
			
		||||
#!/bin/sh
 | 
			
		||||
# $Id: configure,v 1.25 2009-08-16 19:48:17 tcunha Exp $
 | 
			
		||||
# $Id: configure,v 1.26 2009-08-19 15:57:54 nicm Exp $
 | 
			
		||||
 | 
			
		||||
TMUX_PLATFORM=${TMUX_PLATFORM:-`uname -s`}
 | 
			
		||||
 | 
			
		||||
@@ -32,6 +32,7 @@ cat <<EOF >>$CONFIG_H
 | 
			
		||||
#undef HAVE_STRSEP
 | 
			
		||||
#undef HAVE_STRTONUM
 | 
			
		||||
#undef HAVE_TREE_H
 | 
			
		||||
#undef HAVE_TTYDEFCHARS
 | 
			
		||||
#undef HAVE_UTIL_H
 | 
			
		||||
#undef HAVE_VIS
 | 
			
		||||
EOF
 | 
			
		||||
@@ -57,6 +58,7 @@ case $TMUX_PLATFORM in
 | 
			
		||||
#define HAVE_STRSEP
 | 
			
		||||
#define HAVE_STRTONUM
 | 
			
		||||
#define HAVE_TREE_H
 | 
			
		||||
#define HAVE_TTYDEFCHARS
 | 
			
		||||
#define HAVE_UTIL_H
 | 
			
		||||
#define HAVE_VIS
 | 
			
		||||
EOF
 | 
			
		||||
@@ -165,6 +167,7 @@ EOF
 | 
			
		||||
#define HAVE_STRLCAT
 | 
			
		||||
#define HAVE_STRLCPY
 | 
			
		||||
#define HAVE_STRSEP
 | 
			
		||||
#define HAVE_TTYDEFCHARS
 | 
			
		||||
#define HAVE_UTIL_H
 | 
			
		||||
EOF
 | 
			
		||||
	cat <<EOF >>$CONFIG_MK
 | 
			
		||||
@@ -196,6 +199,7 @@ EOF
 | 
			
		||||
#define HAVE_STRLCPY
 | 
			
		||||
#define HAVE_STRTONUM
 | 
			
		||||
#define HAVE_STRSEP
 | 
			
		||||
#define HAVE_TTYDEFCHARS
 | 
			
		||||
EOF
 | 
			
		||||
	cat <<EOF >>$CONFIG_MK
 | 
			
		||||
LIBS+= -lcurses -lcrypt -lutil
 | 
			
		||||
@@ -222,6 +226,7 @@ EOF
 | 
			
		||||
#define HAVE_STRLCAT
 | 
			
		||||
#define HAVE_STRLCPY
 | 
			
		||||
#define HAVE_STRSEP
 | 
			
		||||
#define HAVE_TTYDEFCHARS
 | 
			
		||||
#define HAVE_UTIL_H
 | 
			
		||||
EOF
 | 
			
		||||
	cat <<EOF >>$CONFIG_MK
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user