Originally Posted by crazyc
There shouldn't be any issues enabling that.

Cool. That was one of the things that would crash when I'd experiment.

Now I just have to remember not to try to copy with CTRL+C in the mame console. kaboom! Old habits die hard.


Interestingly, if I type CTRL+V (for paste) I see a ^V in the console, but it takes two deletes to remove it.

If I only delete once after hitting CTRL+V I get this "unexpected symbol" and I could not figure out why my command didn't work.

type print("hello") then CTRL+V and then delete once, the command line looks ok, but there's a bizarro character at the end.

This is with Ubuntu terminal console.

Code
print("hello")
error: 	[string "print("hello")"]:1: unexpected symbol near '<\127>'



I can edit the plugins/console/init.lua and add this line:

Code
local ln = require("linenoise")
ln_global = ln

so I can access the linenoise as the global variable ln_global and then I can save the history as:

Code
ln_global.savehistory("mysavehistoryln.txt")

and loading that into a text editor I can see that there's a strange 007F character at the end.


Is there an easy way of accessing the actual linenoise history entries, like a "history" command in bash, for example?

If I type ln_global. and then hit TAB to complete I get:

Code
ln_global.                                  

addcompletion
clearscreen
sethistorymaxlen
linenoise
lines
historysave
line
preload
loadhistory
savehistory
setcompletion
addhistory
refresh
historyadd
historysetmaxlen
historyload


But none of those seem to give me access to the actual history.


edit:
Hmmm, why not savehistory to /dev/stdout, that seems to work.

Code
ln_global.savehistory("/dev/stdout")

Last edited by Golden Child; 11/22/17 03:55 PM.