mirror of
https://github.com/tmux/tmux.git
synced 2024-11-16 09:28:51 +00:00
Sync OpenBSD patchset 1029:
Add a wrapper function tty_set_size from George Nachman.
This commit is contained in:
parent
3e94fa70f9
commit
290636bc86
1
tmux.h
1
tmux.h
@ -1454,6 +1454,7 @@ void tty_putc(struct tty *, u_char);
|
|||||||
void tty_pututf8(struct tty *, const struct grid_utf8 *);
|
void tty_pututf8(struct tty *, const struct grid_utf8 *);
|
||||||
void tty_init(struct tty *, int, char *);
|
void tty_init(struct tty *, int, char *);
|
||||||
int tty_resize(struct tty *);
|
int tty_resize(struct tty *);
|
||||||
|
int tty_set_size(struct tty *tty, u_int sx, u_int sy);
|
||||||
void tty_start_tty(struct tty *);
|
void tty_start_tty(struct tty *);
|
||||||
void tty_stop_tty(struct tty *);
|
void tty_stop_tty(struct tty *);
|
||||||
void tty_set_title(struct tty *, const char *);
|
void tty_set_title(struct tty *, const char *);
|
||||||
|
13
tty.c
13
tty.c
@ -93,10 +93,8 @@ tty_resize(struct tty *tty)
|
|||||||
sx = 80;
|
sx = 80;
|
||||||
sy = 24;
|
sy = 24;
|
||||||
}
|
}
|
||||||
if (sx == tty->sx && sy == tty->sy)
|
if (!tty_set_size(tty, sx, sy))
|
||||||
return (0);
|
return (0);
|
||||||
tty->sx = sx;
|
|
||||||
tty->sy = sy;
|
|
||||||
|
|
||||||
tty->cx = UINT_MAX;
|
tty->cx = UINT_MAX;
|
||||||
tty->cy = UINT_MAX;
|
tty->cy = UINT_MAX;
|
||||||
@ -116,6 +114,15 @@ tty_resize(struct tty *tty)
|
|||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
tty_set_size(struct tty *tty, u_int sx, u_int sy) {
|
||||||
|
if (sx == tty->sx && sy == tty->sy)
|
||||||
|
return (0);
|
||||||
|
tty->sx = sx;
|
||||||
|
tty->sy = sy;
|
||||||
|
return (1);
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
tty_open(struct tty *tty, const char *overrides, char **cause)
|
tty_open(struct tty *tty, const char *overrides, char **cause)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user