Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 18:38 06 May 2026 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : GFXTerm (Linux) r.2025.08 - problem with MMBasic in EDIT mode

Author Message
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1126
Posted: 04:45am 03 May 2026
Copy link to clipboard 
Print this post

RP2350A on the Silicon chip Pico Computer - 6.03.00B4 HDMIUSB version loaded - neither keyboard nor HDMI connected - connected to PC via USB C (console).

The latest release of MMBasic 6.03.00B4 - in EDIT mode, displays characters as entered but as soon as return is pressed, all text entered disappears.  If the cursor is moved up/down and space bar pressed, the text re-appears with the space correctly entered. Move to the end of the text line and press Enter, everything disappears.
Status line is not displayed at any stage.

Connecting the HDMI then shows all the text correctly coloured but still no display the the GFXTerm window on the PC when in EDIT mode. So problem is only apparent with the console connection and only by GFXTerm.

Works fine for normal command line and works fully for both edit and command line under putty.

Seems to be just GFXTerm that is having trouble with the return character.

Again, everything works correctly with Putty so it appears as if GFXTerm is not correctly catching the Enter key when in edit mode for the HDMIUSB version when used in serial console mode.

Doug.

PS. Test with RP2350B DIL module - 6.03.00b4 loaded and works fine for both GFXTerm and Putty in command line and EDIT.

PSS. Back key brings up the Status line but no text displayed until a line is edited then disapperas again when Return key pressed.
Edited 2026-05-03 15:17 by panky
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2512
Posted: 12:12pm 03 May 2026
Copy link to clipboard 
Print this post

hi Doug,
   did it previously work correctly with versions of mmbasic prior to 6.03.00B4?


when the enter key is pressed, GFXterm generates a single carriage return, chr$(13). this is the same behavior as a real VT100/VT102/VT220 terminal. GFXterm only provides emulation for VT series terminals.

if ctrl-enter is pressed, then GFXterm generates a single linefeed, chr$(10), while if alt-enter is pressed, then it generates a carriage return followed by a linefeed, chr$(13)+chr$(10). try using ctrl-enter and see if 6.03.00B4 behaves more sanely. if it does not, try using alt-enter.


also, check that the screen size within GFXterm is set to match what mmbasic expects. the default is 80 columns x 24 lines, but this can be changed to a non-standard value by right-clicking the mouse (or pressing alt-M), selecting 'screen size' in the popup menu, then adjusting column and row values in the 'select screen size' window that appears.

for example, if mmbasic were expecting a 100-column by 40-line terminal, then set these same values in the 'select screen size' window.


cheers,
rob   :-)
Edited 2026-05-04 02:26 by robert.rozee
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1126
Posted: 12:01am 04 May 2026
Copy link to clipboard 
Print this post

Thanks Rob,

Tried all your suggestions to no avail. Went back to 6.02.01 and 6.00.01 - all the same.
A diagnostic grab of the incoming codes for the HDMIUSB version and the 2350B DIL shows some variations but may be associated with having to output to HDMI ??
Note that I removed the <ESC> text and tried to split it into lines that make sense - this may have introduced false code.


RP2350A in Silicon Chip Pico Computer
running v6.03.00B4 HDMIUSB
Log of characters to console
----------------------------

edit
<CR><LF>[8;40;80t[?7l[?1000h7[2J[H[1;1H[39;1H[35m[4m[0m<CR><LF>
[37mF1:Save F2:RunF3:Find F4:Mark F5:Paste F7:Repl F7/8:Rpl/r
[37m[K[1;1H[1;1H<CR>[33m' remark
[K[37m<CR><LF><CR>
[36mFor[37m x[37m=[32m1[37m [36mTo[37m [32m200
[K[37m<CR><LF><CR>
[37m [36mPrint[37m x
[K[37m<CR><LF><CR>
[36mNext[37m x
[K[37m<CR><LF><CR>
[K[37m<CR><LF><CR>
[36mEnd
[K[37m<CR><LF><CR>
[K[37m<CR><LF><CR>

... whole bunch the same

[K[37m<CR><LF><CR>
[K[37m<CR><LF><CR>
[K[37m<CR><LF>
[6;1H[40;61H[37m         L:6 C:1 INS[37m
[6;1Hs[39;1H[35m[4m [0m<CR><LF>
[37mF1:Save F2:Run F3:Find F4:Mark F5:Paste F7:Repl F7/8:Rpl/r[37m
[K[6;1H[?1000l8[2J[H[37m[0m
[?25h[97;40m>

Now for the RP2350B DIL
-----------------------

edit

<CR><LF>[?1000h7[2J[H[1;1H[23;1H[35m[4m[0m<CR><LF>
[37mF1:Save F2:Run F3:Find F4:MarkF5:Paste F7:Repl F7/8:Rpl/r
[37m[K[1;1H[1;1H<CR>[33m' remark
[K[37m<CR><LF><CR>
[36mFor[37m x[37m [37m=[37m [32m1[37m [36mTo[37m [32m200
[K[37m<CR><LF><CR>
[36mPrint[37m x
[K[37m<CR><LF><CR>
[36mNext[37m x
[K[37m<CR><LF><CR>
[36mEnd
[K[37m<CR><LF><CR>
[K[37m<CR><LF><CR>

.... whole bunch the same

[K[37m<CR><LF><CR>
[K[37m<CR><LF><CR>
[K[37m<CR><LF>
[1;1H[24;61H[37m     L:1 C:1 INS[37m
[1;1H[23;1H[35m[4m[0m<CR><LF>
[37mF1:Save F2:Run F3:Find F4:Mark F5:Paste F7:Repl F7/8:Rpl/r[37m
[K[1;1H[2;1H[2;1H[24;61H[37m       L:2 C:1 INS[37m
[2;1H[3;1H[3;1H[24;61H[37m         L:3 C:1 INS[37m
[3;1H[4;1H[4;1H[24;61H[37m         L:4 C:1 INS[37m
[4;1H[5;1H[5;1H[24;61H[37m         L:5 C:1 INS[37m
[5;1H[24;61H[37m         L:5 C:1 INS[37m
[5;1H[5;2H[24;61H[37m         L:5 C:2 INS[37m[5;2H
[5;3H[24;61H[37m         L:5 C:3 INS[37m[5;3H
[5;4H[24;61H[37m         L:5 C:4 INS[37m[5;4H
[1;1H<CR>
[33m' remark[K[37m<CR><LF><CR>
[36mFor
[37m x[37m [37m=[37m [32m1[37m [36mTo
[37m [32m200[K[37m<CR><LF><CR>
[36mPrint[37m x[K[37m<CR><LF><CR>
[36mNext[37m x[K[37m<CR><LF><CR>
[36mEnd
[K[37m<CR><LF><CR>
[K[37m<CR><LF><CR>

....

[K[37m<CR><LF><CR>
[K[37m<CR><LF>[6;1H[24;61H
[37m         L:6 C:1 INS[37m[6;1H
[?1000l8[2J[H[37m[0m

Saved 59 bytes<CR><LF>

[?25h[97;40m>


Doug.
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1126
Posted: 12:21am 04 May 2026
Copy link to clipboard 
Print this post

Further to above, here is a raw Rx grab of the output from GFXTerm showing the EDIT problem.

Raw-Rx-grab-GFXTerm.pdf

Doug.
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
BarryH

Newbie

Joined: 05/01/2025
Location: Australia
Posts: 34
Posted: 02:11am 04 May 2026
Copy link to clipboard 
Print this post

I don't normally use GFXTerm, but I can confirm @pankey's experience with GFXTerm on a Pico Computer and also on Peters DIL.

I have found that by changing the column size in GFXTerm allows a better editing experience.

If I have OPTION DISPLAY 43,156 set on a Pico, and if GFXTerm originally starts with a screen size of 156 & 43, changing the column size to 157 will fix the editing issues.

However, because GFXTerm remembers its settings, the next time I connect, column size is already 1 larger than what is set on the PICO, but now the editing is again dismal.
Changing the column size in GFXTerm, either back to the PICO setting of 156, or increasing it to 158, fixes the editing for that connection session, but again needs changing when a new connextion is established.

Pico Computer - V6.03.00B2
DIL - V6.03.00B4

Using GFXTerm 2025.38 build

I have additionally noticed, if I reconnect a session without exiting GFXTerm, the editing experience is still good if it was fixed by changing column size previously.
If I completely exit GFXTerm and reconnect, then I do need to change column size.
Edited 2026-05-04 12:20 by BarryH
BarryH
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1126
Posted: 04:12am 04 May 2026
Copy link to clipboard 
Print this post

  panky said   .... analysing further, Barry is right on the money I think

Raw-Rx-grab-GFXTerm.pdf


Looking at the raw data from MMBasic, upon entering EDIT mode, MMB sends the following to the console
<ESC>[8;40;80t    ' unsure but think this sets terminal to 40 lines of 80 characters
                 ' Note: the manual says the default is 24 x 80 for MMB,
                 ' the same is the default for GFXTerm. Setting GFXTerm to 40 x 80
                 ' results in correct display.
                 ' Again, note that OPTION DISPLAY 24,80 in MMB gives the error
                 ' message  Error : Cannot change LCD console

<ESC>[?7l         ' reset autowrap mode
<ESC>[?1000h      ' enable VT200 mouse reporting
<ESC>7            ' save cursor and attributes
<ESC>[2J          ' erase full display
<ESC>[H           ' cursor to upper left corner
<ESC>[1;1H        ' move cursor to line 1, column 1
<ESC>[39;1H       ' move cursor to line 39, column 1
<ESC>[35m         ' foreground colour to magenta
<ESC>[4m          ' 80 spaces follows - underline them ie. draw a line
<ESC>[0m          ' normal ie. turn off underline

.... and so on but the issue appears to be that MMB defaults to 40 lines by 80 columns (where the manual states 24 x 80) whereas GFXTerm defaults to 24 x 80.
Changing GFXTerm to match the MMB 40 x 80 enables EDIT to work OK.  MMB does not appear to allow this setting to be chaged eg. back to 24 x 80

Perhaps the manual could indicate that MMB defaults to 40 x 80 not 24 x 80

Doug.
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2512
Posted: 05:31am 04 May 2026
Copy link to clipboard 
Print this post

it is interesting that the pico is issuing <ESC>[?7l (turn OFF auto line wrap) at the startup of the editor, but apparently not issuing <ESC>[?7h (turn ON auto line wrap) upon exiting the editor.

try the following, using TeraTerm as the terminal emulator, type in at the command prompt:
for i=1 to 200:?i;:next i

when you press the enter key you should see several lines of text displayed, consisting of the numbers 1 to 200 with a space between each. this text should auto wrap at the end of each line. the world is good.

now type in edit to enter the editor. make a change to whatever program is loaded, press the escape key to exit, then press 'Y' to save. this will return you to the command prompt.

lastly type in at the command prompt:
for i=1 to 200:?i;:next i

when you press enter you should see the same set of numbers displayed over several lines. with TeraTerm, i suspect you will see just a single line of output - indicating that the world is not good.


cheers,
rob   :-)
Edited 2026-05-04 15:33 by robert.rozee
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 3186
Posted: 06:27am 04 May 2026
Copy link to clipboard 
Print this post

TeraTerm 5.2
It never wraps. Tried before editor, after editor, after CPU RESTART and a power cycle.
OPTION DISPLAY 50, 152
> for i=1 to 200:?i;:next i
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 0
PicoMite MMBasic RP2040 V6.03.00B4
Copyright 2011-2026 Geoff Graham
Copyright 2016-2026 Peter Mather

> for i=1 to 200 : ? i; : pause 200 : next i
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 0
>

Adding a pause shows the last character of the current "i" number printing to the screen on the right until the loop ends, hence the last 0.
Edited 2026-05-04 16:29 by phil99
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1126
Posted: 06:32am 04 May 2026
Copy link to clipboard 
Print this post

Rob,
Confirmed with putty under Linux Mint - might be one for Peter to look at? Also, either a different default to lines x columns or alter manual.

Doug.
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 11278
Posted: 07:42am 04 May 2026
Copy link to clipboard 
Print this post

When a console device is defined (always for VGA and HDMI, user selectable for TFT displays) MMBasic automatically configures the serial terminal to be the same size in characters as the console device. So 640x480 VGA with font 1 (8x12) will give 80x40. Without a console device the display will be 80x24. This has been the case forever. Recent enhancements in the editor required autowrap to be off and I forgot to set it back on on exit. This will be fixed in B5.
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2512
Posted: 12:07pm 04 May 2026
Copy link to clipboard 
Print this post

  phil99 said  TeraTerm 5.2
It never wraps. Tried before editor, after editor, after CPU RESTART and a power cycle.
OPTION DISPLAY 50, 152
> for i=1 to 200 : ? i; : pause 200 : next i
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 0
>

Adding a pause shows the last character of the current "i" number printing to the screen on the right until the loop ends, hence the last 0.


interesting... with GFXterm set to 80 columns, and an MX170 attached i see:

>
> for i=1 to 200 : ? i; : pause 200 : next i
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 3
0 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187
188 189 190 191 192 193 194 195 196 197 198 199 200
>
>


that is, all 200 numbers are visible in the terminal. from what you are seeing, i would say that later versions of mmbasic are no longer expecting the terminal (or terminal emulator) to automatically wrap onto the next line when the cursor goes off the rhs of the screen. instead mmbasic is now counting characters as they are being outputted, and either not transmitting beyond the number of columns set with OPTION DISPLAY lines, columns, or prefixing every character it believes is beyond the number of columns set with a backspace.

one would be hard pushed to find another implementation of basic (either designed for serial terminal I/O or for driving a screen) that does this!


cheers,
rob   :-)
Edited 2026-05-04 22:29 by robert.rozee
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2512
Posted: 12:20pm 04 May 2026
Copy link to clipboard 
Print this post

  matherp said  [...] Recent enhancements in the editor required autowrap to be off [...]


hi Peter,
   what changes necessitated turning autowrap off? are you doing this so that TeraTerm no longer needs to be instructed (by mmbasic) to set the terminal width to columns+1? i had always wondered about setting the width to columns+1, in particular with respect to terminal emulators that may require the width to be divisible by 8 or 4.

GFXterm handles the situation rather crudely, by simply implementing 'deferred newline'. i believe a real (hardware) VT100/102/220 does the same, though i don't have one to test with   :-(


cheers,
rob   :-)
Edited 2026-05-04 22:24 by robert.rozee
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2026