From: Jeremy N. - ml g. <jn....@wi...> - 2025-05-10 09:07:44
|
On 2025-05-09 00:47, Ethan A Merritt wrote: > As it stands now, the terminal driver API provides only one entry point > for > sending text. When the terminal is initialized, this entry point is > either > set to the enhanced text routine or to the plain text routine. > The "noenhanced" attribute works by temporarily setting a global flag > that can be seen by the terminal's enhanced text routine [see below]. > If the flag is set, the terminal just ignores all the markup > characters. > Going the other way is I suppose possible, but would require new code > in the plain text routine that knows to check some flag or other global > condition and redirect the call to the enhanced text routine instead, > possibly having to deal with initiallization of state variables > (mostly font-related stuff) that would otherwise have been done > when the terminal was first set to enhanced text mode. If the state vars are only used by the enhanced mode then maybe you could sometimes initialise the terminal twice? That is, first always initialise the enhanced routine (to do the font stuff etc), then as if that had not been done (but only if noenhanced was set initially) initialise the plain text routine? Would that leave plain-text in effect exactly as it works now, but mean that temporary switches into enhanced would work? -- Jeremy Nicoll - my opinions are my own |