Previous Thread
Next Thread
Print Thread
Can someone set the console history to 100? #114699
02/17/19 11:16 AM
02/17/19 11:16 AM
Joined: Feb 2014
Posts: 192
G
Golden Child Online content OP
Senior Member
Golden Child  Online Content OP
Senior Member
G
Joined: Feb 2014
Posts: 192
Hi all,

Could someone pretty please set the ln.historysetmaxlen(10) to something like 100? Or if you're feeling generous, 200?

grep -rn history mame206_extract/mame/plugins/*
mame206_extract/mame/plugins/console/init.lua:31: ln.historysetmaxlen(10)


After 10 lines, I've lost my console history....(sung to the tune of You've lost that lovin' feelin)


from 3rdparty/linenoise/linenoise.c

Code
#define LINENOISE_DEFAULT_HISTORY_MAX_LEN 100

...

static int history_max_len = LINENOISE_DEFAULT_HISTORY_MAX_LEN;
static int history_len = 0;
static char **history = NULL;


Re: Can someone set the console history to 100? [Re: Golden Child] #114700
02/17/19 12:48 PM
02/17/19 12:48 PM
Joined: Apr 2015
Posts: 379
E
EoceneMiacid Offline
Senior Member
EoceneMiacid  Offline
Senior Member
E
Joined: Apr 2015
Posts: 379
What stops you from doing a pr?

Re: Can someone set the console history to 100? [Re: Golden Child] #114701
02/17/19 01:24 PM
02/17/19 01:24 PM
Joined: Feb 2014
Posts: 192
G
Golden Child Online content OP
Senior Member
Golden Child  Online Content OP
Senior Member
G
Joined: Feb 2014
Posts: 192
I guess I'll have to figure it out. I'm a bit of a git idiot.

Re: Can someone set the console history to 100? [Re: Golden Child] #114702
02/17/19 01:28 PM
02/17/19 01:28 PM
Joined: Jan 2012
Posts: 800
C
crazyc Offline
Senior Member
crazyc  Offline
Senior Member
C
Joined: Jan 2012
Posts: 800
I'm not opposed to this necessarily but is it necessary to change it by default when you can just edit the script or run "require("linenoise").historysetmaxlen(100)" directly from the console.

Edit: If you need the LINENOISE_DEFAULT_HISTORY_MAX_LEN set to 200 though, that shouldn't be an issue.

Last edited by crazyc; 02/17/19 01:34 PM.
Re: Can someone set the console history to 100? [Re: crazyc] #114703
02/17/19 02:08 PM
02/17/19 02:08 PM
Joined: Feb 2014
Posts: 192
G
Golden Child Online content OP
Senior Member
Golden Child  Online Content OP
Senior Member
G
Joined: Feb 2014
Posts: 192
Hi Crazyc,

It's true I can edit the script, but it'd be really nice to just have a bigger default. We're in the 64 bit gigabyte age, what's a few hundred bytes here and there.

I tend to really mess up the mame source doing my learning experiments, so I download a "fresh zip" on every release and it just one of those things that'd just be nice to have set up by default.

At some point I get annoyed enough by the 10 line maximum length to change it.

I remember that I used to have to edit the Makefile under Ubuntu to compile, but now I just download it and make -j4 and I don't even have to modify the makefile anymore which is awesome.


I'm such an idiot/newbie that I still haven't figured out how to just build a single driver.

I suppose I'm going to have to end the suffering...

http://www.mameworld.info/ubbthread...ded&sb=5&o=&fpart=1&vc=1

Re: Can someone set the console history to 100? [Re: Golden Child] #114704
02/17/19 02:19 PM
02/17/19 02:19 PM
Joined: Feb 2004
Posts: 2,037
Sydney, Australia
Vas Crabb Offline
Very Senior Member
Vas Crabb  Offline
Very Senior Member
Joined: Feb 2004
Posts: 2,037
Sydney, Australia
Code
make SUBTARGET=something SOURCES=src/mame/drivers/intellec4.cpp,src/mame/drivers/anzterm.cpp


It's that simple.

Re: Can someone set the console history to 100? [Re: Vas Crabb] #114705
02/17/19 02:40 PM
02/17/19 02:40 PM
Joined: Feb 2014
Posts: 192
G
Golden Child Online content OP
Senior Member
Golden Child  Online Content OP
Senior Member
G
Joined: Feb 2014
Posts: 192
You're right! That is easy! Oh man I've been doing it the hard way...


make -j4 SUBTARGET=justapple SOURCES=src/mame/drivers/apple2e.cpp REGENIE=1


./justapple64 apple2e

Re: Can someone set the console history to 100? [Re: Golden Child] #114706
02/17/19 03:10 PM
02/17/19 03:10 PM
Joined: Jan 2012
Posts: 800
C
crazyc Offline
Senior Member
crazyc  Offline
Senior Member
C
Joined: Jan 2012
Posts: 800
So I increased the default length to 50 and the max to 200. I also added a history() function that will display the history if called with no parameter or history(n) which will put the nth history entry on the command line.

Re: Can someone set the console history to 100? [Re: Golden Child] #114707
02/17/19 03:50 PM
02/17/19 03:50 PM
Joined: Feb 2014
Posts: 192
G
Golden Child Online content OP
Senior Member
Golden Child  Online Content OP
Senior Member
G
Joined: Feb 2014
Posts: 192
Many thanks, Crazyc!


Who's Online Now
2 registered members (Golden Child, 1 invisible), 167 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Shout Box
Forum Statistics
Forums9
Topics8,635
Posts112,994
Members4,842
Most Online324
Dec 20th, 2018
Powered by UBB.threads™ PHP Forum Software 7.6.1.1
(Release build 20180111)
Page Time: 0.081s Queries: 15 (0.048s) Memory: 5.6520 MB (Peak: 5.8630 MB) Zlib enabled. Server Time: 2019-03-24 15:19:33 UTC