mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Merge branch 'obsd-master'
This commit is contained in:
		
							
								
								
									
										5
									
								
								grid.c
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								grid.c
									
									
									
									
									
								
							@@ -114,6 +114,7 @@ grid_extended_cell(struct grid_line *gl, struct grid_cell_entry *gce,
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
	struct grid_extd_entry	*gee;
 | 
						struct grid_extd_entry	*gee;
 | 
				
			||||||
	int			 flags = (gc->flags & ~GRID_FLAG_CLEARED);
 | 
						int			 flags = (gc->flags & ~GRID_FLAG_CLEARED);
 | 
				
			||||||
 | 
						utf8_char		 uc;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (~gce->flags & GRID_FLAG_EXTENDED)
 | 
						if (~gce->flags & GRID_FLAG_EXTENDED)
 | 
				
			||||||
		grid_get_extended_cell(gl, gce, flags);
 | 
							grid_get_extended_cell(gl, gce, flags);
 | 
				
			||||||
@@ -121,8 +122,10 @@ grid_extended_cell(struct grid_line *gl, struct grid_cell_entry *gce,
 | 
				
			|||||||
		fatalx("offset too big");
 | 
							fatalx("offset too big");
 | 
				
			||||||
	gl->flags |= GRID_LINE_EXTENDED;
 | 
						gl->flags |= GRID_LINE_EXTENDED;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						utf8_from_data(&gc->data, &uc);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	gee = &gl->extddata[gce->offset];
 | 
						gee = &gl->extddata[gce->offset];
 | 
				
			||||||
	utf8_from_data(&gc->data, &gee->data);
 | 
						gee->data = uc;
 | 
				
			||||||
	gee->attr = gc->attr;
 | 
						gee->attr = gc->attr;
 | 
				
			||||||
	gee->flags = flags;
 | 
						gee->flags = flags;
 | 
				
			||||||
	gee->fg = gc->fg;
 | 
						gee->fg = gc->fg;
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										4
									
								
								tmux.h
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								tmux.h
									
									
									
									
									
								
							@@ -259,6 +259,7 @@ enum {
 | 
				
			|||||||
/* Termcap codes. */
 | 
					/* Termcap codes. */
 | 
				
			||||||
enum tty_code_code {
 | 
					enum tty_code_code {
 | 
				
			||||||
	TTYC_ACSC,
 | 
						TTYC_ACSC,
 | 
				
			||||||
 | 
						TTYC_AM,
 | 
				
			||||||
	TTYC_AX,
 | 
						TTYC_AX,
 | 
				
			||||||
	TTYC_BCE,
 | 
						TTYC_BCE,
 | 
				
			||||||
	TTYC_BEL,
 | 
						TTYC_BEL,
 | 
				
			||||||
@@ -479,7 +480,6 @@ enum tty_code_code {
 | 
				
			|||||||
	TTYC_TSL,
 | 
						TTYC_TSL,
 | 
				
			||||||
	TTYC_U8,
 | 
						TTYC_U8,
 | 
				
			||||||
	TTYC_VPA,
 | 
						TTYC_VPA,
 | 
				
			||||||
	TTYC_XENL,
 | 
					 | 
				
			||||||
	TTYC_XT
 | 
						TTYC_XT
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1258,7 +1258,7 @@ struct tty_term {
 | 
				
			|||||||
	struct tty_code	*codes;
 | 
						struct tty_code	*codes;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define TERM_256COLOURS 0x1
 | 
					#define TERM_256COLOURS 0x1
 | 
				
			||||||
#define TERM_NOXENL 0x2
 | 
					#define TERM_NOAM 0x2
 | 
				
			||||||
#define TERM_DECSLRM 0x4
 | 
					#define TERM_DECSLRM 0x4
 | 
				
			||||||
#define TERM_DECFRA 0x8
 | 
					#define TERM_DECFRA 0x8
 | 
				
			||||||
#define TERM_RGBCOLOURS 0x10
 | 
					#define TERM_RGBCOLOURS 0x10
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										17
									
								
								tty-term.c
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								tty-term.c
									
									
									
									
									
								
							@@ -57,6 +57,7 @@ struct tty_term_code_entry {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
static const struct tty_term_code_entry tty_term_codes[] = {
 | 
					static const struct tty_term_code_entry tty_term_codes[] = {
 | 
				
			||||||
	[TTYC_ACSC] = { TTYCODE_STRING, "acsc" },
 | 
						[TTYC_ACSC] = { TTYCODE_STRING, "acsc" },
 | 
				
			||||||
 | 
						[TTYC_AM] = { TTYCODE_FLAG, "am" },
 | 
				
			||||||
	[TTYC_AX] = { TTYCODE_FLAG, "AX" },
 | 
						[TTYC_AX] = { TTYCODE_FLAG, "AX" },
 | 
				
			||||||
	[TTYC_BCE] = { TTYCODE_FLAG, "bce" },
 | 
						[TTYC_BCE] = { TTYCODE_FLAG, "bce" },
 | 
				
			||||||
	[TTYC_BEL] = { TTYCODE_STRING, "bel" },
 | 
						[TTYC_BEL] = { TTYCODE_STRING, "bel" },
 | 
				
			||||||
@@ -277,7 +278,6 @@ static const struct tty_term_code_entry tty_term_codes[] = {
 | 
				
			|||||||
	[TTYC_TSL] = { TTYCODE_STRING, "tsl" },
 | 
						[TTYC_TSL] = { TTYCODE_STRING, "tsl" },
 | 
				
			||||||
	[TTYC_U8] = { TTYCODE_NUMBER, "U8" },
 | 
						[TTYC_U8] = { TTYCODE_NUMBER, "U8" },
 | 
				
			||||||
	[TTYC_VPA] = { TTYCODE_STRING, "vpa" },
 | 
						[TTYC_VPA] = { TTYCODE_STRING, "vpa" },
 | 
				
			||||||
	[TTYC_XENL] = { TTYCODE_FLAG, "xenl" },
 | 
					 | 
				
			||||||
	[TTYC_XT] = { TTYCODE_FLAG, "XT" }
 | 
						[TTYC_XT] = { TTYCODE_FLAG, "XT" }
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -586,17 +586,22 @@ tty_term_create(struct tty *tty, char *name, int *feat, int fd, char **cause)
 | 
				
			|||||||
	tty_term_apply_overrides(term);
 | 
						tty_term_apply_overrides(term);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/*
 | 
						/*
 | 
				
			||||||
	 * Terminals without xenl (eat newline glitch) wrap at at $COLUMNS - 1
 | 
						 * Terminals without am (auto right margin) wrap at at $COLUMNS - 1
 | 
				
			||||||
	 * rather than $COLUMNS (the cursor can never be beyond $COLUMNS - 1).
 | 
						 * rather than $COLUMNS (the cursor can never be beyond $COLUMNS - 1).
 | 
				
			||||||
	 *
 | 
						 *
 | 
				
			||||||
	 * This is irritating, most notably because it is impossible to write
 | 
						 * Terminals without xenl (eat newline glitch) ignore a newline beyond
 | 
				
			||||||
	 * to the very bottom-right of the screen without scrolling.
 | 
						 * the right edge of the terminal, but tmux doesn't care about this -
 | 
				
			||||||
 | 
						 * it always uses absolute only moves the cursor with a newline when
 | 
				
			||||||
 | 
						 * also sending a linefeed.
 | 
				
			||||||
 | 
						 *
 | 
				
			||||||
 | 
						 * This is irritating, most notably because it is painful to write to
 | 
				
			||||||
 | 
						 * the very bottom-right of the screen without scrolling.
 | 
				
			||||||
	 *
 | 
						 *
 | 
				
			||||||
	 * Flag the terminal here and apply some workarounds in other places to
 | 
						 * Flag the terminal here and apply some workarounds in other places to
 | 
				
			||||||
	 * do the best possible.
 | 
						 * do the best possible.
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	if (!tty_term_flag(term, TTYC_XENL))
 | 
						if (!tty_term_flag(term, TTYC_AM))
 | 
				
			||||||
		term->flags |= TERM_NOXENL;
 | 
							term->flags |= TERM_NOAM;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Generate ACS table. If none is present, use nearest ASCII. */
 | 
						/* Generate ACS table. If none is present, use nearest ASCII. */
 | 
				
			||||||
	memset(term->acs, 0, sizeof term->acs);
 | 
						memset(term->acs, 0, sizeof term->acs);
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										18
									
								
								tty.c
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								tty.c
									
									
									
									
									
								
							@@ -564,7 +564,7 @@ tty_putc(struct tty *tty, u_char ch)
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
	const char	*acs;
 | 
						const char	*acs;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if ((tty->term->flags & TERM_NOXENL) &&
 | 
						if ((tty->term->flags & TERM_NOAM) &&
 | 
				
			||||||
	    ch >= 0x20 && ch != 0x7f &&
 | 
						    ch >= 0x20 && ch != 0x7f &&
 | 
				
			||||||
	    tty->cy == tty->sy - 1 &&
 | 
						    tty->cy == tty->sy - 1 &&
 | 
				
			||||||
	    tty->cx + 1 >= tty->sx)
 | 
						    tty->cx + 1 >= tty->sx)
 | 
				
			||||||
@@ -586,11 +586,11 @@ tty_putc(struct tty *tty, u_char ch)
 | 
				
			|||||||
				tty->cy++;
 | 
									tty->cy++;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			/*
 | 
								/*
 | 
				
			||||||
			 * On !xenl terminals, force the cursor position to
 | 
								 * On !am terminals, force the cursor position to where
 | 
				
			||||||
			 * where we think it should be after a line wrap - this
 | 
								 * we think it should be after a line wrap - this means
 | 
				
			||||||
			 * means it works on sensible terminals as well.
 | 
								 * it works on sensible terminals as well.
 | 
				
			||||||
			 */
 | 
								 */
 | 
				
			||||||
			if (tty->term->flags & TERM_NOXENL)
 | 
								if (tty->term->flags & TERM_NOAM)
 | 
				
			||||||
				tty_putcode2(tty, TTYC_CUP, tty->cy, tty->cx);
 | 
									tty_putcode2(tty, TTYC_CUP, tty->cy, tty->cx);
 | 
				
			||||||
		} else
 | 
							} else
 | 
				
			||||||
			tty->cx++;
 | 
								tty->cx++;
 | 
				
			||||||
@@ -600,7 +600,7 @@ tty_putc(struct tty *tty, u_char ch)
 | 
				
			|||||||
void
 | 
					void
 | 
				
			||||||
tty_putn(struct tty *tty, const void *buf, size_t len, u_int width)
 | 
					tty_putn(struct tty *tty, const void *buf, size_t len, u_int width)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if ((tty->term->flags & TERM_NOXENL) &&
 | 
						if ((tty->term->flags & TERM_NOAM) &&
 | 
				
			||||||
	    tty->cy == tty->sy - 1 &&
 | 
						    tty->cy == tty->sy - 1 &&
 | 
				
			||||||
	    tty->cx + len >= tty->sx)
 | 
						    tty->cx + len >= tty->sx)
 | 
				
			||||||
		len = tty->sx - tty->cx - 1;
 | 
							len = tty->sx - tty->cx - 1;
 | 
				
			||||||
@@ -1875,7 +1875,7 @@ tty_cmd_cells(struct tty *tty, const struct tty_ctx *ctx)
 | 
				
			|||||||
	    ctx->xoff + ctx->ocx + ctx->num > ctx->wox + ctx->wsx)) {
 | 
						    ctx->xoff + ctx->ocx + ctx->num > ctx->wox + ctx->wsx)) {
 | 
				
			||||||
		if (!ctx->wrapped ||
 | 
							if (!ctx->wrapped ||
 | 
				
			||||||
		    !tty_full_width(tty, ctx) ||
 | 
							    !tty_full_width(tty, ctx) ||
 | 
				
			||||||
		    (tty->term->flags & TERM_NOXENL) ||
 | 
							    (tty->term->flags & TERM_NOAM) ||
 | 
				
			||||||
		    ctx->xoff + ctx->ocx != 0 ||
 | 
							    ctx->xoff + ctx->ocx != 0 ||
 | 
				
			||||||
		    ctx->yoff + ctx->ocy != tty->cy + 1 ||
 | 
							    ctx->yoff + ctx->ocy != tty->cy + 1 ||
 | 
				
			||||||
		    tty->cx < tty->sx ||
 | 
							    tty->cx < tty->sx ||
 | 
				
			||||||
@@ -1931,7 +1931,7 @@ tty_cell(struct tty *tty, const struct grid_cell *gc,
 | 
				
			|||||||
	const struct grid_cell	*gcp;
 | 
						const struct grid_cell	*gcp;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Skip last character if terminal is stupid. */
 | 
						/* Skip last character if terminal is stupid. */
 | 
				
			||||||
	if ((tty->term->flags & TERM_NOXENL) &&
 | 
						if ((tty->term->flags & TERM_NOAM) &&
 | 
				
			||||||
	    tty->cy == tty->sy - 1 &&
 | 
						    tty->cy == tty->sy - 1 &&
 | 
				
			||||||
	    tty->cx == tty->sx - 1)
 | 
						    tty->cx == tty->sx - 1)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
@@ -2087,7 +2087,7 @@ tty_cursor_pane_unless_wrap(struct tty *tty, const struct tty_ctx *ctx,
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
	if (!ctx->wrapped ||
 | 
						if (!ctx->wrapped ||
 | 
				
			||||||
	    !tty_full_width(tty, ctx) ||
 | 
						    !tty_full_width(tty, ctx) ||
 | 
				
			||||||
	    (tty->term->flags & TERM_NOXENL) ||
 | 
						    (tty->term->flags & TERM_NOAM) ||
 | 
				
			||||||
	    ctx->xoff + cx != 0 ||
 | 
						    ctx->xoff + cx != 0 ||
 | 
				
			||||||
	    ctx->yoff + cy != tty->cy + 1 ||
 | 
						    ctx->yoff + cy != tty->cy + 1 ||
 | 
				
			||||||
	    tty->cx < tty->sx ||
 | 
						    tty->cx < tty->sx ||
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user