MMBasic ANSI - MMBasic on Mac/Windows/Linux in a terminal
Author
Message
robert.rozee Guru Joined: 31/12/2012 Location: New ZealandPosts: 2541
Posted: 11:44am 26 May 2026
libc problems fixed, it now runs happily under linux mint 19.3 and using the --console-only parameter produces usable output.
but while ctrl-Z is fixed, both ctrl-C and ctrl-D are not handled and terminate mmbasic. the problems with ctrl-C and -D, as well as the original with ctrl-Z can all be fixed by placing the terminal in RAW mode. the following pascal (FPC) code does this, taken from a serial-over-TCP/IP VT102 emulation hack i wrote a few years back:
program talkto;
uses sysutils, termIO, BaseUnix;
var tios, SAVEDtios:termios;
begin TCGetAttr(0, tios); SAVEDtios:=tios; CFMakeRaw(tios); TCSetAttr(0, TCSANOW, tios); // place console in RAW mode
repeat // main loop, use break to exit until false;
TCSetAttr(0, TCSANOW, SAVEDtios) // restore console state end.
hopefully converting this into C should be simple!
btw, option list seems to not work. i tested by setting and resetting option colourcode on/off where option list produced no output no matter what the setting was.
if desired, you could make options persistent by saving them in a .ini file of the same name and location as the mmbasic binary. this .ini file could then also hold settings such as --console-only. but this is all just a suggestion!
cheers, rob :-) Edited 2026-05-26 21:49 by robert.rozee