[BRLTTY] Feature request: configurable prompt pattern

Aura Kelloniemi kaura.dev at sange.fi
Tue Mar 13 09:14:57 EDT 2018


Aura Kelloniemi <kaura.dev at sange.fi> writes:
 > What I would want to have is a Perl-style (or sed-style) regex substitution,
 > where the original string is the current line. Like this:

 > s/^([^ ]+ ).*/\1/

 > Then the result of the substitution is compared to screen contents to find
 > other prompts.

No, even that does not work. It would allow for some extensibility, but would
not work when the prompt itself is changing, like it is doing in IRB.

It should be such that the result of the substitution is treated as a new
regular expression which is matched against other lines on the screen to find
other prompts. (This would require that the back-references are escaped before
substitution, which makes libpcre routines less useful.) And this admittedly
makes the whole feature complex to use, even for intermediate users. But at
least those who have experience doing programming could benefit from it and
the default setting could be tweaked such that it would take into account some
common cases, like irb.

Is there any other way to make NXPROMPT and PRPROMPT more generic?

-- 
Aura


More information about the BRLTTY mailing list