View | Details | Raw Unified | Return to bug 247464
Collapse All | Expand All

(-)b/bin/stty/modes.c (+2 lines)
Lines 129-134 static const struct modes imodes[] = { Link Here
129
	{ "-decctlq",	IXANY, 0 },
129
	{ "-decctlq",	IXANY, 0 },
130
	{ "imaxbel",	IMAXBEL, 0 },
130
	{ "imaxbel",	IMAXBEL, 0 },
131
	{ "-imaxbel",	0, IMAXBEL },
131
	{ "-imaxbel",	0, IMAXBEL },
132
	{ "iutf8",	IUTF8, 0 },
133
	{ "-iutf8",	0, IUTF8 },
132
	{ NULL,		0, 0 },
134
	{ NULL,		0, 0 },
133
};
135
};
134
136
(-)b/bin/stty/stty.1 (+2 lines)
Lines 211-216 empty/full. Link Here
211
Allow any character (allow only
211
Allow any character (allow only
212
.Dv START )
212
.Dv START )
213
to restart output.
213
to restart output.
214
.It Cm iutf8 Pq Fl iutf8
215
Erase multibyte UTF-8 letters.
214
.It Cm imaxbel Pq Fl imaxbel
216
.It Cm imaxbel Pq Fl imaxbel
215
The system imposes a limit of
217
The system imposes a limit of
216
.Dv MAX_INPUT
218
.Dv MAX_INPUT
(-)b/share/man/man4/termios.4 (+11 lines)
Lines 876-881 following masks: Link Here
876
/* enable input flow control */
876
/* enable input flow control */
877
.It Dv IXANY
877
.It Dv IXANY
878
/* any char will restart after stop */
878
/* any char will restart after stop */
879
.It Dv IUTF8
880
/* make ERASE character remove UTF-8 multibyte letters */
879
.It Dv IMAXBEL
881
.It Dv IMAXBEL
880
/* ring bell on input queue full */
882
/* ring bell on input queue full */
881
.El
883
.El
Lines 1052-1057 and Link Here
1052
characters are transmitted are implementation defined.
1054
characters are transmitted are implementation defined.
1053
.Pp
1055
.Pp
1054
If
1056
If
1057
.Dv IUTF8
1058
and
1059
.Dv ICANON
1060
are set,
1061
every letter would be removed as a UTF-8 multibyte letter upon receipt of the
1062
.Dv ERASE
1063
character.
1064
.Pp
1065
If
1055
.Dv IMAXBEL
1066
.Dv IMAXBEL
1056
is set and the input queue is full, subsequent input shall cause an
1067
is set and the input queue is full, subsequent input shall cause an
1057
.Tn ASCII
1068
.Tn ASCII
(-)b/sys/kern/tty.c (-1 / +1 lines)
Lines 86-92 static const char *dev_console_filename; Link Here
86
 * Flags that are supported and stored by this implementation.
86
 * Flags that are supported and stored by this implementation.
87
 */
87
 */
88
#define TTYSUP_IFLAG	(IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK|ISTRIP|\
88
#define TTYSUP_IFLAG	(IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK|ISTRIP|\
89
			INLCR|IGNCR|ICRNL|IXON|IXOFF|IXANY|IMAXBEL)
89
			INLCR|IGNCR|ICRNL|IXON|IXOFF|IXANY|IMAXBEL|IUTF8)
90
#define TTYSUP_OFLAG	(OPOST|ONLCR|TAB3|ONOEOT|OCRNL|ONOCR|ONLRET)
90
#define TTYSUP_OFLAG	(OPOST|ONLCR|TAB3|ONOEOT|OCRNL|ONOCR|ONLRET)
91
#define TTYSUP_LFLAG	(ECHOKE|ECHOE|ECHOK|ECHO|ECHONL|ECHOPRT|\
91
#define TTYSUP_LFLAG	(ECHOKE|ECHOE|ECHOK|ECHO|ECHONL|ECHOPRT|\
92
			ECHOCTL|ISIG|ICANON|ALTWERASE|IEXTEN|TOSTOP|\
92
			ECHOCTL|ISIG|ICANON|ALTWERASE|IEXTEN|TOSTOP|\
(-)b/sys/kern/tty_ttydisc.c (-3 / +10 lines)
Lines 737-745 ttydisc_rubchar(struct tty *tp) Link Here
737
	int quote;
737
	int quote;
738
	unsigned int prevpos, tablen;
738
	unsigned int prevpos, tablen;
739
739
740
	if (ttyinq_peekchar(&tp->t_inq, &c, &quote) != 0)
740
#define MULTIBYTE(u) (((u) & 0x80) == 0x80)
741
		return (-1);
741
#define FIRST_OCTET(u) (((u) & 0xC0) == 0xC0)
742
	ttyinq_unputchar(&tp->t_inq);
742
	bool utf8 = CMP_FLAG(i, IUTF8);
743
	do {
744
		if (ttyinq_peekchar(&tp->t_inq, &c, &quote) != 0)
745
			return (-1);
746
		ttyinq_unputchar(&tp->t_inq);
747
	} while(utf8 && MULTIBYTE(c) && !FIRST_OCTET(c));
748
#undef MULTIBYTE
749
#undef FIRST_OCTET
743
750
744
	if (CMP_FLAG(l, ECHO)) {
751
	if (CMP_FLAG(l, ECHO)) {
745
		/*
752
		/*
(-)b/sys/sys/_termios.h (+1 lines)
Lines 98-103 Link Here
98
#endif
98
#endif
99
#if __BSD_VISIBLE
99
#if __BSD_VISIBLE
100
#define	IMAXBEL		0x00002000	/* ring bell on input queue full */
100
#define	IMAXBEL		0x00002000	/* ring bell on input queue full */
101
#define	IUTF8		0x00004000	/* support UTF-8 encoding */
101
#endif
102
#endif
102
103
103
/*
104
/*

Return to bug 247464