Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 17:47 01 May 2024 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 : PicoM + GFXterm: editor highlighting not correct

     Page 2 of 3    
Author Message
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3848
Posted: 02:12pm 14 Jun 2021
Copy link to clipboard 
Print this post

  matherp said  There is nothing to fix. I'm using a perfectly valid escape sequence which as demonstrated above is correctly handled by both teraterm ...


I'm not denying that they are valid for a certain definition of "valid", though I would argue if pushed that use of the older standard 16-colours would be a more robust and perhaps kinder approach.

  Quote  ... and putty


That isn't true on the Pi (it may be on other platforms), PuTTY does not render these codes correctly, all the colours are shades of cyan and grey ... though it occurs to me that this might be controllable via a PuTTY option, I will investigate later/tomorrow.

Could I please prevail upon you to point us at where in the MMBasic code (e.g. the "published" Armmite source) these colours are defined/used so that (a) I can understand and (b) Rob can, if he so chooses, adapt GFXterm to handle them based upon the "single source of truth" ?

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3547
Posted: 02:40pm 14 Jun 2021
Copy link to clipboard 
Print this post

Have currently no means of shooting a picture, but Putty on Linux (ubuntu 16.04.7) behaves the similar to GFXterm (Cyan (Keywords), Green(comments), White(variables and numbers) and Grey(task bar)).

Something fishy...like the wrong pallet ?

An MX170 on the same terminal has the colors correct (wel...it has black ink on black background for the taskbar, but that was expected behavior). Red, yellow, etc...
Edited 2021-06-15 00:47 by Volhout
PicomiteVGA PETSCII ROBOTS
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3848
Posted: 02:46pm 14 Jun 2021
Copy link to clipboard 
Print this post

  Volhout said  Have currently no means of shooting a picture, but Putty on Linux (ubuntu 16.04.7) behaves the similar to GFXterm (Cyan (Keywords), Green(comments), White(variables and numbers) and Grey(task bar)).

Something fishy...like the wrong pallet ?


Perhaps, does the Linux version have this option page (from Windoze):



Is there some selection of options in the top-panel that "fixes" the discrepancy ?

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3848
Posted: 02:51pm 14 Jun 2021
Copy link to clipboard 
Print this post

Note I wouldn't be so damn persistent/irritating (delete as applicable) about this but for the fact that the CMM2 EDITors syntax highlighting works fine with TeraTerm, PuTTY and GFXterm (mostly) so it is possible to make everyone happy - and yes, I know that the CMM2's EDITor has a different lineage, but it must (?) still be using VT control codes for syntax highlighting over the serial console.

Best wishes,

Tom
Edited 2021-06-15 00:53 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2290
Posted: 03:40pm 14 Jun 2021
Copy link to clipboard 
Print this post

TeraTerm emulates a number of different standards, covering dozens of different terminals, and thousands of different escape sequences:
ECMA-48
AIXterm
Xterm
VT100 to VT340 (and VT525)
TEK4010
the authors of TeraTerm have literally scoured the web, collecting up enormous lists of escape sequences that have been compiled over the last 50 years, and - wherever they can - added support for those escape sequences to TeraTerm.

they have done this so that you can connect to almost anything and TeraTerm will have a good chance of being able to make sense of the data being sent back to it. TeraTerm even supports many miss-formed escape sequences, presumably to accommodate some obscure devices out there that erroneously produce them.

as such, TeraTerm is a highly versatile, extremely complex tool. it is the swiss-army knife of terminal emulators; you would be hard-pushed to find an escape sequence that it does NOT support. it also only runs under windows.


GFXterm has been written to support the MicroMite family. it supports a few dozen escape sequences based upon VT102, VT2xx (mouse), and a 16-entry colour palette (VT525). the complete list of supported escape sequences fits on two sides of an A4 sheet with space to spare:
Partial VT220 Command Set.pdf


GFXterm will never be able to compete against TeraTerm. if someone wishes to pick out arbitrary 'useful looking' escape sequences from the list supported by TeraTerm, they will be able to break GFXterm (well, it will gracefully ignore the unknown escape sequences). they will also be able to break every other terminal emulator out there that is not TeraTerm.


cheers,
rob   :-(
Edited 2021-06-15 01:46 by robert.rozee
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3659
Posted: 04:44pm 14 Jun 2021
Copy link to clipboard 
Print this post

  thwill said  Perhaps, does the Linux version have this option page (from Windoze):



Tom

Almost the same, yes. (Under Window | Colours)

John
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3547
Posted: 06:49pm 14 Jun 2021
Copy link to clipboard 
Print this post

My linux version does not have
Use system colours
Attempt to use logical pallet

volhout
PicomiteVGA PETSCII ROBOTS
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5907
Posted: 06:58am 15 Jun 2021
Copy link to clipboard 
Print this post

Colours are a very personal choice, What I like will not suit others.

The original CMM could only do a limited range of colours so it made no sense to use 256 colours in the editor.
The newer systems are not limited as much so it opens up the possibility to use a bigger range.
Peter has chosen to incorporate some xterm escape sequences and both Teraterm and Putty should be able to correctly decode them.

MMEdit can't (but the next update can) but no one in their right mind would want to use the terminal in MMEdit.
I have fixed the colours but there is another problem I need to track down.

I see two reasons for sticking to the standard 8 colours.
1. Most terminal programs allow users to redefine those colours to suit their preference. You can't do that with RGB colours.
2. The standard colours take a lot less data to implement so serial comms will be better with the standard 8. Not a problem over a direct USB link but significant over TCPIP etc.

Reason 1 is worth consideration.

Jim
VK7JH
MMedit   MMBasic Help
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3848
Posted: 09:09am 15 Jun 2021
Copy link to clipboard 
Print this post

  TassyJim said  Peter has chosen to incorporate some xterm escape sequences and both Teraterm and Putty should be able to correctly decode them.


Sorry Jim, but wrt PuTTY this does not appear to be the case. Of the terminals I've tested only TeraTerm renders the colours as intended:

- PuTTY (now tested on Windows and Raspberry Pi) renders comments as grey (should be yellow) and numbers as white (should be red-ish).
 - I've played with the "Windows->Colours" options and that hasn't helped, though unchecking "Allow terminal to specify ANSI colours" does generate monochrome output.
 - If someone is seeing different would they please "correct me", Captain aren't you using PuTTY ?
 - Can someone confirm the behaviour of an Armmite since Peter has suggested they have the same code.

- GFXterm as PuTTY except it also misses some of the token transitions and thus renders some tokens in the colour of the previous token

Best Wishes,

Tom
Edited 2021-06-15 19:12 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5732
Posted: 09:37am 15 Jun 2021
Copy link to clipboard 
Print this post

The F4 uses the same colours as the PicoMite, Tom.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3848
Posted: 09:41am 15 Jun 2021
Copy link to clipboard 
Print this post

  Mixtel90 said  The F4 uses the same colours as the PicoMite, Tom.


Is that a visual confirmation, or extrapolation from what Peter has said ?

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5732
Posted: 10:05am 15 Jun 2021
Copy link to clipboard 
Print this post

I plugged the F4 in just to find out. :)
It's still connected if you'd like me to check anything.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3848
Posted: 10:17am 15 Jun 2021
Copy link to clipboard 
Print this post

  Mixtel90 said  I plugged the F4 in just to find out. :)
It's still connected if you'd like me to check anything.


No, that's fine, it just excludes any unintended PicoMite specific funny business.

Now I just cross my fingers and wait for Peter to take pity, or for Geoff to make the source-code available so I can "fix" it in a private build.

Best wishes,

Tom
Edited 2021-06-15 20:17 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5732
Posted: 10:18am 15 Jun 2021
Copy link to clipboard 
Print this post

VT100 - 16 standard colours

'foreground colour demo
For i=0 To 15
 vz$="38;5;"+Str$(i)+"m"
 Print Chr$(27)+"[";
 Print vz$
 Print "Colour "i"   Foreground colour demo"
Next
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3848
Posted: 10:46am 15 Jun 2021
Copy link to clipboard 
Print this post

  Mixtel90 said  VT100 - 16 standard colours

'foreground colour demo
For i=0 To 15
 vz$="38;5;"+Str$(i)+"m"
 Print Chr$(27)+"[";
 Print vz$
 Print "Colour "i"   Foreground colour demo"
Next


You can tie yourself in knots on this stuff - did the VT100 even have colour or was it a later VT or ANSI standard ?

In any case that isn't the "earliest" and most supported way of doing it (GFXterm won't support that for a start), try:

Print Chr$(27) + "[0mDefault:"
For i = 31 To 37
 vz$ = Str$(i) + "m"
 Print Chr$(27) + "[" vz$;
 Print "Colour" i " Foreground colour demo"
Next

Print
Print Chr$(27) + "[0mFaint:"
For i = 31 To 37
 vz$ = "2;" + Str$(i) + "m"
 Print Chr$(27) + "[" vz$;
 Print "Colour" i " Foreground colour demo"
Next

Print
Print Chr$(27) + "[0mBold:"
For i = 31 To 37
 vz$ = "1;" + Str$(i) + "m"
 Print Chr$(27) + "[" vz$;
 Print "Colour" i " Foreground colour demo"
Next


TeraTerm renders the Default and Faint the same way, but GFXterm makes them different

Also the default TeraTerm white as displayed for the labels doesn't match either the "Faint" or "Bold" whites

It's a crap shoot.

Best wishes,

Tom
Edited 2021-06-15 20:54 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5732
Posted: 11:12am 15 Jun 2021
Copy link to clipboard 
Print this post

Correct - the DEC VT100 was a mono terminal, one of the first to support ANSI escape codes. The codes themselves are, of course, ANSI (and modified ANSI) - not DEC or anyone else.

A lovely article: https://en.wikipedia.org/wiki/ANSI_escape_code

It looks like the SGR system can be a pain. :)

However,
CHR$(27+"[38;5;colournum"+"m" is sensible because it sets a defined colour, not some guess at "light","normal", or "bold" which seem to rarely do what they say. lol

CHR$(27+"[38;2;r;g;b"+"m" should probably give you 8:8:8 r,g,b colours nowadays.
.
.
Edited 2021-06-15 22:12 by Mixtel90
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 3547
Posted: 12:26pm 15 Jun 2021
Copy link to clipboard 
Print this post

And the solution is: OPTION COLOURCODE OFF (and let your grey brains cells do a little more work)

Too bad, Geoff released the new Micromite 5.05.04 without the colourcode fix for black background....

Volhout
PicomiteVGA PETSCII ROBOTS
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5907
Posted: 04:40am 16 Jun 2021
Copy link to clipboard 
Print this post

  thwill said  
  TassyJim said  Peter has chosen to incorporate some xterm escape sequences and both Teraterm and Putty should be able to correctly decode them.


Sorry Jim, but wrt PuTTY this does not appear to be the case. Of the terminals I've tested only TeraTerm renders the colours as intended:

Tom


You are right.
I mistook the 256 colour  option as rgb instead of a 256 colour lookup pallet.

I have now cobbled a short test program for testing
 OPTION EXPLICIT
 OPTION DEFAULT NONE
 DIM INTEGER n
 DIM STRING E$ = CHR$(27)+"["
 CLS
 PRINT e$+"0m"
 PRINT " Setting both foreground and background "
 PRINT
 PRINT " Basic 8 colours esc [ 30-37"
 FOR n = 0 TO 7
   PRINT e$+STR$(40+n)+";"+STR$(30+n)+"m OOO ";
 NEXT n
 PRINT e$+"0m"
 PRINT " Bold Basic 8 colours"
 FOR n = 0 TO 7
   PRINT e$+"1;"+STR$(40+n)+";"+STR$(30+n)+"m OOO ";
 NEXT n
 PRINT e$+"0m"
 PRINT " Dim Basic 8 colours"
 FOR n = 0 TO 7
   PRINT e$+"2;"+STR$(40+n)+";"+STR$(30+n)+"m OOO ";
 NEXT n
 PRINT e$+"0m"
 PRINT " Bright colours - esc [ 90-97 "
 FOR n = 0 TO 7
   PRINT e$+STR$(90+n)+";"+STR$(100+n)+"m OOO ";
 NEXT n
 PRINT e$+"0m"
 PRINT
 PRINT " 256 colour lookup test - esc [ 48;5;n m"
 FOR n = 0 TO 15
   PRINT e$+"48;5;"+STR$(n)+"m"+e$+"38;5;"+STR$(n)+"m O   ";
 NEXT n
 FOR n = 16 TO 231
   IF n MOD 36 = 16 THEN PRINT ""
   PRINT e$+"48;5;"+STR$(n)+"m"+e$+"38;5;"+STR$(n)+"m O";
 NEXT n
 PRINT
 FOR n = 232 TO 255
   PRINT e$+"48;5;"+STR$(n)+"m"+e$+"38;5;"+STR$(n)+"m O ";
 NEXT n
 PRINT
 PRINT e$+"0m"
 PRINT " True colour test - esc [ 48;2;r;g;b m"
 FOR n = 0 TO 255 STEP 8
   PRINT e$+"48;2;"+STR$(n)+";0;0m"+e$+"38;2;"+STR$(n)+";0;0m O";
 NEXT n
 PRINT
 FOR n = 0 TO 255 STEP 8
   PRINT e$+"48;2;0;"+STR$(n)+";0m"+e$+"38;2;0;"+STR$(n)+";0m O";
 NEXT n
 PRINT
 FOR n = 0 TO 255 STEP 8
   PRINT e$+"48;2;0;0;"+STR$(n)+"m"+e$+"38;2;0;0;"+STR$(n)+"m O";
 NEXT n
 PRINT
 FOR n = 0 TO 255 STEP 8
   PRINT e$+"48;2;0;"+STR$(n)+";"+STR$(n)+"m"+e$+"38;2;0;"+STR$(n)+";"+STR$(n)+"m O";
 NEXT n
 PRINT
 FOR n = 0 TO 255 STEP 8
   PRINT e$+"48;2;"+STR$(n)+";0;"+STR$(n)+"m"+e$+"38;2;"+STR$(n)+";0;"+STR$(n)+"m O";
 NEXT n
 PRINT
 FOR n = 0 TO 255 STEP 8
   PRINT e$+"48;2;"+STR$(n)+";"+STR$(n)+";0m"+e$+"38;2;"+STR$(n)+";"+STR$(n)+";0m O";
 NEXT n
 PRINT
 PRINT e$+"0m"


Jim
VK7JH
MMedit   MMBasic Help
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5907
Posted: 05:00am 16 Jun 2021
Copy link to clipboard 
Print this post

And the winner is
Kitty (sorry, Windows only)
https://www.fosshub.com/KiTTY.html
Kitty is a fork of Putty with a few extra features added.
It correctly renders DIM text. DIM and BOLD do not change the backcolour.



Compared to TeraTerm:



Jim
VK7JH
MMedit   MMBasic Help
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2290
Posted: 05:09am 16 Jun 2021
Copy link to clipboard 
Print this post

  TassyJim said  And the winner is
Kitty (sorry, Windows only)
https://www.fosshub.com/KiTTY.html
Kitty is a fork of Putty with a few extra features added.
It correctly renders DIM text. DIM and BOLD do not change the backcolour.
Jim


hi jim,
  have you tried Kitty with an MX170 and with OPTION COLOURCODE ON editing a program? that is the cruncher.


cheers,
rob   :-)
 
     Page 2 of 3    
Print this page
© JAQ Software 2024