![]() |
Forum Index : Microcontroller and PC projects : Minor Feature Request for Micromite
Author | Message | ||||
Oldbitcollector![]() Senior Member ![]() Joined: 16/05/2014 Location: United StatesPosts: 172 |
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 My Propeller/Micromite mini-computer project. |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3269 |
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: AustraliaPosts: 6220 |
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 |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3269 |
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 StatesPosts: 172 |
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: ThailandPosts: 2209 |
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: AustraliaPosts: 3269 |
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 StatesPosts: 172 |
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: AustraliaPosts: 120 |
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: AustraliaPosts: 6220 |
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. Jim VK7JH MMedit |
||||
Oldbitcollector![]() Senior Member ![]() Joined: 16/05/2014 Location: United StatesPosts: 172 |
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 My Propeller/Micromite mini-computer project. |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6220 |
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 |
||||
Oldbitcollector![]() Senior Member ![]() Joined: 16/05/2014 Location: United StatesPosts: 172 |
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: AustraliaPosts: 6220 |
Jeff, Test your code with MARKing text (F4) and scrolling text. If you are happy with the results, all is well. Jim VK7JH MMedit |
||||
Oldbitcollector![]() Senior Member ![]() Joined: 16/05/2014 Location: United StatesPosts: 172 |
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. |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |