Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 10:44 25 Nov 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 : Picomite V5.09.00RC5 - Commandline wrapping

Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9110
Posted: 07:30am 09 Jun 2024
Copy link to clipboard 
Print this post

Thanks to Gerry (disco4now) for some great new functionality that I have included in V5.09.00RC5
I attach his notes. The download is available from the usual place (see the main release candidate thread )

PicoMite: Console Commandline wrapping

History
MMBasic allows a program line to be 255 characters. The Micromites allow a long commandline to be entered via the console by wrapping the command to the next line on the terminal. Limited correction/editing of the command is allowed by using the BackSpace key to go back and retype the last part of the command on the most recent line.

The Picomites were enhanced by adding a command history buffer and more editing capabilities. e.g. left/right arrow keys,Home,End,INS,Del and the ability to recall previous commands via the Up and Down arrow keys. The support for wrapping the command  to a second line was lost so commands entered via the console are limited to the console width.

This Update
This update restores the ability to wrap commands on the console to the full 255 characters. The command line wrapping has been designed to expect the VT100 terminal to have its terminal width set to Option.Width+1 to match the width expected by the EDIT command and now also the Console. Wrapping the command over multiple lines is also supported when the console is via on LCD Panel (i.e. OPTION LCDPANEL CONSOLE) or the screen on a PicomiteVGA.

TeraTerm,Putty and MMCC(MMEdit) can have the number columns and rows set by sending an escape sequence  with the number of rows and columns. (lets call it setterminal). MMBasic will attempt set the required number of columns and rows under the following rules.

* No setterminal is sent at the initial command prompt or when a program is started. i.e. it won't ever change your terminal size unless you trigger one the the following conditions.

* OPTION DISPLAY (with no parameters)  
will attempt to set the terminal based the current values of Option.Height and Option.Width+1. Use this to initially set your terminal to match the default values.
(GFXTerm will need to have the terminal size manually set).

If OPTION LCDPANEL CONSOLE is in use Option.Width and Option.Height are determined by the font size used and can be less than the default sizes. The implementation will NEVER set the VT100 rows to less than 24(40 for PicoVGA) and columns to less than 81 based on the default terminal size.

* OPTION DISPLAY rows,columns
Sets Option.Height, Option.Width to the specified values and attempts to set the VT100 terminal to match.

* EDIT command will attempt to set the terminal based on Option.Height and Option.Width, but will NEVER set rows to less than 24(40) and columns to less than 81 based on the default terminal size. This means the VT100 is minimum 24*81 even if we have an LCD PANEL CONSOLE which is smaller.The EDIT command is happy with a terminal larger than it needs so the fullscreen editor on the VT100 and the LCD PANEL Console remain in sync if using both. If an LCD PANEL CONSOLE is greater than 24*81 then the VT100 will be set to match it.

* OPTION LCDPANEL CONSOLE font
This will also set the VT100 terminal based on the new calculated Option.Height and Option.Width to match the LCD PANEL console and font, but will NEVER set rows to less than 24 and columns to less than 81 based on the default terminal size.

* OPTION LCDPANEL NOCONSOLE
Will restore the VT100 to the default 24*81 size based on the now default Option.Height and Option.width after the LCDPANEL CONSOLE is disabled.

* OPTION LCDPANEL DISABLE (while Option.Console is set)
Will restore the VT100 to the default 24*81 size based on the now default Option.Height and Option.width after the LCDPANEL is disabled.

NOSCROLL and MM.PROMPT
When NOSCROLL is in used and a command is being enter that will cause a rewrite, the command is proactively written at the top of the console.
If a recalled command  (Up/Down arrow) will cause a rewrite it is proactively written at the top of the console including the > prompt so command is aligned as normal.
If MM.PROMPT is being used the alignment will match the custom prompt size.

EDIT Command fixes

These two small issues with the EDIT command are corrected.
(Note: the Micromites also have these issues)
The last character in a line is not shown in the editor if the line is exactly the length of the Option.Width
In Mark mode (select) a line of length exactly Option.Width gives message LINE TOO LONG if trying to select using F4 then END key.
Same message is given if try to select within a block with either the UP or DOWN arrow key.


Testing
Tested on Picomite and PicomiteVGA.
Not tested on USB versions or WebMite, but hopefully would work.

A quick test is to enter the line.
PRINT "the quick brown fox jumps over the lazy dog and now is the time for all good men to come to the aid of the party"

Try the Left/Right arrow keys, Home and End, backspace etc to check editing over multiple lines functions correctly.


VT100 terminals
Line wrapping tested on the following terminals.
They must allow terminal resizing of have the correct size set manually.
TeraTerm - OK
Putty    - OK
GFXTerm  - OK  (manual set terminal)
MMCC     - Will allow wrapping but a couple of issues if editing across multiple                 lines.

It has not tested on any Linux terminals.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6783
Posted: 07:43am 09 Jun 2024
Copy link to clipboard 
Print this post

This looks *really good*!

but
my
head
hurts...

;)

Many thanks, Gerry & Peter. :)
Mick

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

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6098
Posted: 08:20am 09 Jun 2024
Copy link to clipboard 
Print this post

I have done a partial fix for MMCC but there are still a few oddities to fix.

Jim
VK7JH
MMedit   MMBasic Help
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2135
Posted: 08:39am 09 Jun 2024
Copy link to clipboard 
Print this post

Wow, you can almost fit War and Peace in a one-liner!! ;)
 
Print this page


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

© JAQ Software 2024