Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 18:18 18 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 : Minor Feature Request for Micromite

Author Message
Oldbitcollector

Senior Member

Joined: 16/05/2014
Location: United States
Posts: 172
Posted: 03:05pm 17 Jun 2014
Copy link to clipboard 
Print this post

Geoff,

Is there a chance you could include a small feature in the next release of the Micromite code?

If I run the following program, it changes the background/text colors.

[code]
Print CHR$(27)+"[37;41;1m"
Print "Hello World"
[/code]

Could you prevent the EDITOR from changing back to white on black?
Being able to choose a "restful" color of my own would be awesome for coding.

Thanks
Jeff
Edited by Oldbitcollector 2014-06-19
My Propeller/Micromite mini-computer project.
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3167
Posted: 06:17pm 17 Jun 2014
Copy link to clipboard 
Print this post

OK, I did not realise that the editor was doing that. I wonder what escape code is doing the resetting? (sorry for my bad English).

I presume that you are using Tera Term?

I will add it to my list when I get back. I am currently at Lake Tahoe, a nice place.

Geoff


Geoff Graham - http://geoffg.net
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5923
Posted: 09:58pm 17 Jun 2014
Copy link to clipboard 
Print this post

At the beginning of the line of underlined spaces (the line above the help), the underline attribute is set "ESC[0m". At the end of the line the normal character attribute is sent "ESC[0m".

PRINT CHR$(27)+"[37;41;1m"
PRINT "Hello World"
DO:LOOP UNTIL INKEY$<>""
PRINT CHR$(27)+"[0m"
PRINT "Hello World"


I am not sure if you can remove the underline while keeping the colour set.

In TeraTerm under window setup, you can configure the colours for each attribute.

Jim

VK7JH
MMedit   MMBasic Help
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3167
Posted: 03:08am 18 Jun 2014
Copy link to clipboard 
Print this post

Ah, thanks Jim, that explains it. "ESC[0m" resets all attributes and it is used to reset the underline attribute in the editor. Unfortunately you cannot reset one attribute at a time, it is all or nothing,

Geoff
Geoff Graham - http://geoffg.net
 
Oldbitcollector

Senior Member

Joined: 16/05/2014
Location: United States
Posts: 172
Posted: 04:57am 18 Jun 2014
Copy link to clipboard 
Print this post

Geoff,

How about a compromise? Instead of underline use dashes instead?

Jeff


My Propeller/Micromite mini-computer project.
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 08:49am 18 Jun 2014
Copy link to clipboard 
Print this post

I think making it configurable would be best.
For example: Editor.Color=value and Editor.Background=value

then it not matter in which mode the screen was it will always go to your preference.

Microblocks. Build with logic.
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3167
Posted: 11:01am 18 Jun 2014
Copy link to clipboard 
Print this post

Rather than mess with MMBasic to fix a Tera Term issue cannot Tera Term be made to show the correct colours all the time?

I don't have it here to test,

Geoff
Geoff Graham - http://geoffg.net
 
Oldbitcollector

Senior Member

Joined: 16/05/2014
Location: United States
Posts: 172
Posted: 11:10am 18 Jun 2014
Copy link to clipboard 
Print this post

I'm not using Tera Term...

I've written a VT100 compatible terminal for the Propeller Microcontroller.

I might take a crack at a simple modification of the source code and see if I can create the result I'm looking for. I just thought it might be of interest to others who are using VT100 color codes.

Jeff

My Propeller/Micromite mini-computer project.
 
VK2MCT
Senior Member

Joined: 30/03/2012
Location: Australia
Posts: 120
Posted: 12:41pm 18 Jun 2014
Copy link to clipboard 
Print this post

If I was to accidentally set the text and background to the same colour, how easy would it be to recover?

John.
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5923
Posted: 01:00pm 18 Jun 2014
Copy link to clipboard 
Print this post

  VK2MCT said   If I was to accidentally set the text and background to the same colour, how easy would it be to recover?

John.


PRINT CHR$(27)+"[0m"

I just realised that I made an error in my original post.

the underline attribute is set "ESC[0m".
should read
the underline attribute is set "ESC[4m".

If you are sending VT100 codes in your own program, you can do almost anything. Having a key sequence to get the display back to normal would be vital. If your program crashes, the VT100 terminal could easily be left in an undesirable configuration.

JimEdited by TassyJim 2014-06-19
VK7JH
MMedit   MMBasic Help
 
Oldbitcollector

Senior Member

Joined: 16/05/2014
Location: United States
Posts: 172
Posted: 02:19pm 18 Jun 2014
Copy link to clipboard 
Print this post

So what I need is a way to "set" our display options after ESC[0 is used.

Since my code is reading the data from a serial (console) input line from the Micromite, maybe I can find a way to "insert" the options I want after ESC[0 is detected. Not sure how it will effect the editor, but I'm going to give it a go.

Jeff


Edited by Oldbitcollector 2014-06-20
My Propeller/Micromite mini-computer project.
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5923
Posted: 02:49pm 18 Jun 2014
Copy link to clipboard 
Print this post

Yes that should work provided you also check for the "m" as well. Cursor positioning is not affected.

The only other time that the editor uses character attributes is for inverse when MARKing text. ("ESC[7m") It then uses "ESC[0m" to revert to normal text.
To be complete, you would have to intercept "ESC[4m" and "ESC[7m" and set your attributes for them also otherwise you will have colour for normal but black and white for underline and inverse.

There may be other attributes used (now or in the future) but they are the only two I know for sure.

Jim
VK7JH
MMedit   MMBasic Help
 
Oldbitcollector

Senior Member

Joined: 16/05/2014
Location: United States
Posts: 172
Posted: 03:11pm 18 Jun 2014
Copy link to clipboard 
Print this post

Jim,

Here's what I'm doing now..

Let the ESC[0 go by, then pass an additional ESC[37;41;1m before any new text is sent.

The end result is a one black bar above the underline, but that goes away one any movement is initiated.

Best option?

Jeff

My Propeller/Micromite mini-computer project.
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5923
Posted: 03:31pm 18 Jun 2014
Copy link to clipboard 
Print this post

Jeff,
Test your code with MARKing text (F4) and scrolling text.
If you are happy with the results, all is well.

Jim
VK7JH
MMedit   MMBasic Help
 
Oldbitcollector

Senior Member

Joined: 16/05/2014
Location: United States
Posts: 172
Posted: 05:20pm 18 Jun 2014
Copy link to clipboard 
Print this post

Geoff,

Please consider my feature request cancelled!

Next time I'm trying to get my mind around how to accomplish something with the Micromite, I'll post up and hope that TassyJim tosses some through provoking comments back.

Thanks Jim for making me sit and think this all the way through.
I've got it working wonderfully now.

Editor pops up in wonderful colors instead of depressing white on black. :)

Jeff

My Propeller/Micromite mini-computer project.
 
Print this page


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

© JAQ Software 2024