mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-15 01:57:40 -05:00
Add line-length limit feature in StripCtrlChars.
Now it can optionally check that output lines don't go beyond a certain length (measured in terminal columns, via wcwidth, rather than bytes or characters). In this mode, lines are prefixed with a distinctive character (namely '|'), and if a line is too long, then it is broken and the continuation line gets a different prefix ('>'). When StripCtrlChars is targeting a terminal, it asks the terminal to call wcwidth on its behalf, so it can be sure to use the same idea as the real terminal about which characters are wide (i.e. depending on the configuration of ambiguous characters). This mode isn't yet used anywhere.
This commit is contained in:
@ -344,6 +344,10 @@ static inline bool in_utf(Terminal *term)
|
||||
|
||||
unsigned long term_translate(
|
||||
Terminal *term, term_utf8_decode *utf8, unsigned char c);
|
||||
static inline int term_char_width(Terminal *term, unsigned int c)
|
||||
{
|
||||
return term->cjk_ambig_wide ? mk_wcwidth_cjk(c) : mk_wcwidth(c);
|
||||
}
|
||||
|
||||
/*
|
||||
* UCSINCOMPLETE is returned from term_translate if it's successfully
|
||||
|
Reference in New Issue
Block a user