TimJTi opened a new issue, #15933:
URL: https://github.com/apache/nuttx/issues/15933
### Description / Steps to reproduce the issue
I am adding a few VT100 escape sequence decode functions to a NuttX console
app I am writing and think there are some errors in the vt100.h header file.
For example:
`
#define VT100_CURSORLF(n) {ASCII_ESC, '[', (n), 'D'} /* Move cursor
left n lines */
`
I assume that to use this you would do something like:
`
static const char g_cursorlf[] = VT100_CURSORLF(1);
`
but that expands to `{ASCII_ESC, '[', (1), 'D'} `. Should it not be:
`
#define VT100_CURSORLF(n) {ASCII_ESC, '[', 'n', 'D'} /* Move cursor
left n columns */
`
If I'm right and not missed anything obvious (i.e. I'm being stupid!) I can
submit a PR.
Also, for this, since "n" could be any number (not sure if just 1..9 or if
it could be 1..99 or even 1..any) then I think a wildcard alternative might be
useful, perhaps like this:
`
#define VT100_CURSORLF {ASCII_ESC, '[', '*', 'D'} /* Move cursor
left any number of columns */
`
this will allow a decode function to skip 1 character (*) or 2 (**) or 3
(***) whilst waiting for the 'D' and then pass the number of columns to move to
the function that implements the cursor move. There are no current decode
functions for VT100 codes (bar one) so I'm in new territory here.
Does that seem sensible or is there a better "trick" for this?
### On which OS does this issue occur?
[OS: Linux]
### What is the version of your OS?
Not really relevant!
### NuttX Version
master
### Issue Architecture
[Arch: all]
### Issue Area
[Area: Other]
### Host information
_No response_
### Verification
- [x] I have verified before submitting the report.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]