Page 1 of 2

Implement command history

Posted: Mon Jul 11, 2016 11:42 pm
by robsoft
And here's the second question that I've been thinking about.

Does anyone know of anything that implements a command history? I'm thinking of a Unix/DOS type shell where you could press up and down arrow to work through the last few commands entered. I imagine you possibly can't get do this but if there was a way to intercept or hijack keypresses then you could probably cover the whole up/down thing, and the only real problem would be a way of capturing the 'line' before the QL processed it. So you'd also have to hijack the return key, I guess, store the line in a buffer, then allow the QL to process the line as usual.

If this is all well trodden ground, completely impossible due to certain QL internals that most of you already understand and know about, please just shoot me down and I'll look for another problem to tackle. But it there are things a little like this out there, it might be interesting to try and play with it - I certainly find entering direct commands a pain without some element of line-history.

Re: Implement command history

Posted: Tue Jul 12, 2016 12:57 am
by robsoft
(Though in true fashion, I was in the TK2 manual a little while ago looking for something else and discovered the ALT-ENTER function; while not exactly giving me a scrollable command history, it's certainly useful to be able to get the last command 'back' like that).

Re: Implement command history

Posted: Tue Jul 12, 2016 7:05 am
by tofro
Look for "history" on Dilwyn's site at http://www.dilwyn.me.uk/tk/index.html

TK2 command callback using <ALT>+<ENTER> is nice, but normally recalls exactly the command line before the one I was looking for...

Tobias

Re: Implement command history

Posted: Tue Jul 12, 2016 8:54 am
by Derek_Stewart
Hi,

Why not look at Dilwyn's web site under the Toolkit section there is a History extension that will allow scrolling back and forwards with the cursor keys.

Re: Implement command history

Posted: Tue Jul 12, 2016 11:44 am
by robsoft
Ah, thanks guys - not only does that confirm that it can be done, but that it might already have been done - cheers :-)

Re: Implement command history

Posted: Tue Jul 12, 2016 7:24 pm
by swensont
> not only does that confirm that it can be done, but that it might already have been done

Might? No, it has been done. I've been using the history device driver since the late 90's.

Tim Swenson

Re: Implement command history

Posted: Wed Mar 13, 2024 3:29 pm
by t0nyt
Sorry for bringing an old thread back but it seemed better than starting a new one

I've tried the History 1.23 & 1.27 on Dilwyn's download page and on both a real QL and Q-emuLator I Just get a black screen and a hang as soon as I lrespr the cde file

Any ideas please?

Many thanks
Tony

Re: Implement command history

Posted: Wed Mar 13, 2024 3:45 pm
by ones' complement
LRESPR PTR_GEN first ?

Re: Implement command history

Posted: Wed Mar 13, 2024 3:55 pm
by t0nyt
ones' complement wrote: Wed Mar 13, 2024 3:45 pm LRESPR PTR_GEN first ?
I don't use the pointer environment or know anything about it (but Dilwyn's site says it can be used without PE), or is this just a utility please?

Many thanks

Re: Implement command history

Posted: Wed Mar 13, 2024 3:58 pm
by desin
boot disk
QPAC1440.zip
(790.97 KiB) Downloaded 26 times
Greetings from Switzerland
Markus