|
Forum Index : Microcontroller and PC projects : What's with the ''[?7h'' prompt?
| Author | Message | ||||
Grogster![]() Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 10030 |
On all new FW versions of both the PM builds, this is the default command prompt. What's up with this? How do I disable it and just go back to the standard > prompt? This is NOT visible on the VGA or HDMI output, but only on the console. Is this something to do with advanced graphics control of the connected terminal? I tried turning colourcode OFF, but it made no difference to the console prompt - it's still there.... Smoke makes things work. When the smoke gets out, it stops! |
||||
| phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 3372 |
Perhaps a fresh download and reinstall the firmware as my Picos have the normal prompt with the latest firmware. Alternatively SUB MM.PROMPT PRINT "> "; END SUB |
||||
TassyJim![]() Guru Joined: 07/08/2011 Location: AustraliaPosts: 6598 |
VT terminal code ESC [?7h turns on auto-wrap mode MMCC ignores it but you shouldn't be seeing it on any VTxxx terminal Jim VK7JH MMedit |
||||
| robert.rozee Guru Joined: 31/12/2012 Location: New ZealandPosts: 2552 |
from GFXguide.pdf: "AutoWrap at end-of-line is hard-wired on, and cursor positioning is permanently fixed to absolute - location (1,1) being top-left of the terminal screen irrespective of any top or bottom margins set with DECSTBM." because it is hardwired on (who would ever want to turn it off???) the sequence ESC [?7h is treated as not being a valid escape sequence and sent on to the video output routines. the ESC character is non-displaying, so you end up just see the remaining "[?7h" part. this is how GFXterm handles all escape sequences it can not process. however, i would expect you to also still see a ">" either before or after the "[?7h" text. can you please check this? i am not aware of any terminal emulator that defaults to turning AutoWrap off, and can see no good reason why anyone would want to adjust the setting. if anyone can think of a good reason, i'd be interested in hearing it. most likely the escape sequence was inserted into the mmbasic source code by a friendly AI trying to help out. if you ask Peter nicely, i am sure he can correct the error. cheers, rob :-) |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 11801 |
Auto wrap needs to be off otherwise print ; can cause a wrap. And on the last line a scroll. MMBasic used to circumvent this by setting the character width to 81. Now it does it properly. |
||||
| robert.rozee Guru Joined: 31/12/2012 Location: New ZealandPosts: 2552 |
hi Peter, on a real VT100 terminal, generally print; where the cursor finishes up directly to the right of the rightmost column would not cause a carriage-return or linefeed. instead, the arrival of the next printable character would generate the carriage-return and linefeed. this is not an issue, as a real VT100 terminal has space on the CRT to the right of the text area where the cursor can sit. on both GFXterm and TeraTerm this is handled by holding the cursor in the rightmost column on screen, but internally (hidden from the user) recording the location as being to the right of it. are you able to provide a circumstance where the behavior of GFXterm and TeraTerm has in the past proven problematic? cheers, rob :-) Edited 2026-08-29 03:03 by robert.rozee |
||||
| robert.rozee Guru Joined: 31/12/2012 Location: New ZealandPosts: 2552 |
gemini sums it up more elegantly: Q: with a VT100 terminal, where is the cursor positioned after a character has been printed in the rightmost column? A: "After printing a character in the rightmost column, the cursor remains positioned at that rightmost column rather than wrapping immediately. How VT100 Line Wrapping Works + Deferred Wrap: DEC VT terminals use a deferred wrap mechanism (sometimes called a soft-wrap or "VT100 glitch"). + Current Position: The character is drawn in the final column, but the cursor does not advance or wrap yet. + Next Action: The cursor waits in an anomalous "pending wrap" state at the edge of the screen. + The Wrap Trigger: The cursor only moves to the first column of the next line when the next printable character arrives." i had always assumed that a real VT100 'parked' the cursor to the right of column 80, but it looks like it instead does what GFXterm and TeraTerm do - further proof of the perils of assumption! cheers, rob :-) Edited 2026-08-29 04:39 by robert.rozee |
||||
Grogster![]() Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 10030 |
Before. Here is an image: ![]() Smoke makes things work. When the smoke gets out, it stops! |
||||
| robert.rozee Guru Joined: 31/12/2012 Location: New ZealandPosts: 2552 |
hi Graeme, do you ever see "[?7l"appear? ie, with an "l" (lowercase L) instead of an "h". i'm trying to figure out what Peter is trying to accomplish by adding in these escape sequences all over the place. try running the following test program (screen size set to 80x24), capturing screen shots where prompted and post the two captured images: Const ESC=Chr$(27) Print ESC "[2J" ESC "[1;1H"; Print "hello" Print "there" Print "world" For I= 1 To 200 Print Chr$(48+(I Mod 10)); Next I Print :Print "#" Print "*** capture screen shot now ***" Do :Pause 10:Loop Until Inkey$<>"" Do :Pause 10:Loop While Inkey$<>"" For I=1 To 250 If I<=50 Then Print Else Print Chr$(48+(I Mod 10)); Next I Print : Print "#" Print "*** capture another screen shot ***" End if you can, perhaps then try running using TeraTerm as the terminal emulator. if Peter is just sending ESC "[?7h" sequences (AutoWrap ON), then i can safely discard them as GFXterm is already hardwired into that mode. but if he is sending AutoWrap OFF sequences sometimes, that makes life much more complicated for me. cheers, rob :-) Edited 2026-08-29 15:33 by robert.rozee |
||||
| phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 3372 |
Entered your program segments at the GFXterm command line (putting loops in one line). Only "[?7h" sequences appear. No "[?7l" appear. On Win10 ![]() ![]() In TeraTerm output is the same but without "[?7h" sequences. Edit Loading the whole program changes things. ![]() This image was pasted over the previous one and was displaced a little so ignore the column of characters on the left. ![]() Edited 2026-08-29 15:26 by phil99 |
||||
| mozzie Guru Joined: 15/06/2020 Location: AustraliaPosts: 429 |
G'day, The esc[?7h was introduced at V6.03.00RC0 or RC2, it is sent at every line at the command prompt but not from within a program if using print etc. The starting sequence entering the editor with V6.03.01 is: [?1000h[?7l7[2J[H[1;1H[23;1H[4m and on exit is: [1;1H[?1000l[?7h8[2J[H[37m[0m[?25h[97;40m> [?7h and on every line after: > [?7h > [?7h > [?7h > [?7h I had a simple terminal program written and this caused me some headaches until I figured it out. If talking to a PicoMite via the CDC channel this may need to be accounted for. This little program was to test if the esc[?7h needed to be sent every line, at least with TeraTerm it only needs to be sent once but I seem to remember reports of other terminal programs causing trouble. > list ' prog to test console output For i = 1 To 2 Print Chr$(27)+"[?7l scroll off" prntline Print Chr$(27)+"[?7h scroll on" prntline Next Sub prntline Print "Hello, this is a short line" Print "This a really long line to test the longline system by exceeding the ma ximum width of the terminal screen" End Sub End > Direct Output (Captured with Realterm): > [?7hrun [?7l scroll off Hello, this is a short line This a really long line to test the longline system by exceeding the maximum wid th of the terminal screen [?7h scroll on Hello, this is a short line This a really long line to test the longline system by exceeding the maximum wid th of the terminal screen [?7l scroll off Hello, this is a short line This a really long line to test the longline system by exceeding the maximum wid th of the terminal screen [?7h scroll on Hello, this is a short line This a really long line to test the longline system by exceeding the maximum wid th of the terminal screen [?25h[97;40m> [?7h VT100 Terminal mode: > run scroll off Hello, this is a short line This a really long line to test the longline system by exceeding the maximum win scroll on Hello, this is a short line This a really long line to test the longline system by exceeding the maximum wid th of the terminal screen scroll off Hello, this is a short line This a really long line to test the longline system by exceeding the maximum win scroll on Hello, this is a short line This a really long line to test the longline system by exceeding the maximum wid th of the terminal screen > Hopefully this can be reverted back to only being sent once if this doesn't cause problems elsewhere. Regards, Lyle. |
||||
TassyJim![]() Guru Joined: 07/08/2011 Location: AustraliaPosts: 6598 |
I agree with Lyle, The only time I have seen ESC[?7l is when starting the editor. MMCC ignores both commands but does filter them out so they are not visible. MMCC users have to switch word-wrap on/off as required. They did cause some grief until I filtered them out of the data stream in the file manager. There it was only ESC[?h (and the mouse ones) Jim VK7JH MMedit |
||||
| robert.rozee Guru Joined: 31/12/2012 Location: New ZealandPosts: 2552 |
GFXterm has AutoWrap at end-of-line hard-wired ON. it also ignores the non-VT commands that attempt to resize the terminal window. to date it has always worked fine both when within the editor and when outside of the editor provided the number of rows and columns have been set to exactly match the screen size held by mmbasic. some time ago someone said that GFXterm needed to be set to width+1 in order to display correctly. as far as i have been able to determine this assertion is FALSE. cheers, rob :-) |
||||
| mozzie Guru Joined: 15/06/2020 Location: AustraliaPosts: 429 |
G'day, Can anyone with experience with the VT100 system comment on the following: This line: (Enter Editor) [?1000h[?7l7[2J[H[1;1H[23;1H[4m esc[?7l = DECRST DECAWM = Disable AutoWrap then esc7 (DECSC) saves this setting This line: (Exit Editor) [1;1H[?1000l[?7h8[2J[H[37m[0m[?25h[97;40m> [?7h esc[?7h = DECSET DECAWM = Enable AutoWrap then esc8 (DECRC) recovers previous setting and sets esc[?7l again overriding it. Would having esc8 then esc[?7h remove the need to send it at every newline at the command prompt? Regards, Lyle. |
||||
| robert.rozee Guru Joined: 31/12/2012 Location: New ZealandPosts: 2552 |
Lyle, the above decodes to: Enter Editor... ESC [?1000h ' Enable VT200 Mouse reporting ESC [?7l ' AutoWrap OFF ESC 7 ' Save Cursor and attributes ESC [2J ' Erase in Display, Full Screen ESC [H ' Cursor Position at (1,1) ESC [1;1H ' Cursor Position at (1,1) ESC [23;1H ' Cursor Position at (line 23, column 1) ESC [4m ' SGR: underline Exit Editor... ESC [1;1H ' Cursor Position at (1,1) ESC [?1000l ' Disable VT200 Mouse reporting ESC [?7h ' AutoWrap ON ESC 8 ' Restore Cursor and attributes ESC [2J ' Erase in Display, Full Screen ESC [H ' Cursor Position at (1,1) ESC [37m ' foreground colour = 7 (white) ESC [0m ' SGR: normal ESC [?25h ' Show Text Cursor ESC [97;40m ' 97 = set foreground bright white, 40 = set background 0 (black) ESC [?7h ' AutoWrap ON GFXterm, as i recall, does not support ESC [97m as this is a later addition that introduced an additional brightness level above 'normal'. GFXterm: 8 colour palette, supporting NORMAL and DIM foreground. TeraTerm: BRIGHT, NORMAL and DIM foreground. possibly also 2 levels of background. cheers, rob :-) Edited 2026-08-29 21:22 by robert.rozee |
||||
| Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 9098 |
The MMBasic console isn't really a VT100 (or even VT52) terminal or emulator. It seems a little unfair to expect it to work like one. It understands the fundamentals and that's usually enough. Mick Zilog Inside! nascom.info for Nascom & Gemini |
||||
| robert.rozee Guru Joined: 31/12/2012 Location: New ZealandPosts: 2552 |
Geoff's policy over the years has always been to keep the group of VT escape sequences used as small as possible, in order to achieve compatibility with the maximum number of terminals and terminal emulators out there. as such, the editor doesn't even use scroll regions. the only expansions beyond the basic VT100 sequences are: - VT200 Mouse reporting (a transparent addition that just repositions the cursor), and, - foreground/background colour selection via 3n/4n SGR codes (30..37, 39, 40..47, 49). i'm still waiting to hear back from Peter about why he is: 1. turning AutoWrap OFF upon entering the editor, and ON every time the prompt is displayed. has he found a terminal emulator that does not implement 'Deferred Wrap'? 2. why SGR codes 97 and 40 are applied (ESC [97;40m) after exiting the editor, when ESC 7 and ESC 8 have already been used to save/restore cursor position and SGR settings (including foreground and background colours) as well as AutoWrap state. amongst other things, this prevents the terminal from having a default foreground colour other than white (ie, green text on a black background). cheers, rob :-) Edited 2026-08-29 23:58 by robert.rozee |
||||
| robert.rozee Guru Joined: 31/12/2012 Location: New ZealandPosts: 2552 |
the following would probably suffice when entering the editor: ESC 7 ' Save Cursor and attributes ESC [?7l ' AutoWrap OFF (although i believe not needed) ESC [2J ' Erase in Display, Full Screen ESC [H ' Cursor Position at (1,1) ESC [?1000h ' Enable VT200 Mouse reporting while the following when exiting the editor: ESC [?1000l ' Disable VT200 Mouse reporting ESC 8 ' Restore Cursor and attributes ESC [2J ' Erase in Display, Full Screen ESC [H ' Cursor Position at (1,1) there should then be no need for mmbasic to ever send ESC [?7h. problem solved. cheers, rob :-) Edited 2026-08-30 08:48 by robert.rozee |
||||
| phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 3372 |
Now ok in PicoMite MMBasic RP2040 V6.03.02b1 |
||||
Grogster![]() Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 10030 |
I assume that means that Peter is sorting this out. I expect we'll hear from him in due course about this issue..... ![]() Smoke makes things work. When the smoke gets out, it stops! |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2026 |