Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Keymappings/backspace/insert/overwrite using Stata/Linux at the console


From   Dave Ewart <[email protected]>
To   [email protected]
Subject   Re: st: Keymappings/backspace/insert/overwrite using Stata/Linux at the console
Date   Thu, 17 May 2007 08:59:50 +0100

On Wednesday, 16.05.2007 at 09:00 +0100, Dave Ewart wrote:

> > >Something that I've been wondering about for a while: is there any
> > >way to modify the way that Stata's command-line editing works,
> > >specifically for Stata 9 under Linux, working at the console (i.e.
> > >'stata' rather than 'xstata')?
> > >
> > >By default, command-line editing is in 'overwrite' mode, which
> > >means that if you type:
> > >
> > >  use ataset.dta
> > >
> > >and realise that I meant 'dataset.dta', I move the cursor on to the
> > >'a' at the start of 'ataset' and then type 'd', I see:
> > >
> > >  use dtaset.dta
> > >
> > >which isn't what I want either.  Instead, I must hit my "Insert"
> > >key first.
> > >
> > > [...]

To follow up my own post, with a possible solution that I have
discovered: one can wrap the Stata process with 'rlwrap', which is
GNU-Readline wrapper to any process, allowing GNU-Readline-style command
line editing.

e.g.

 rlwrap -a -c -b ' ' stata-se

which allows one to do the usual command-line editing *and* also stores
the Stata command history (between sessions, as well as within sessions)
*and* enables filename completion for files in the current directory.

Some fine-tuning may be needed of the rlwrap parameters, depending on
one's one circumstances, terminal settings and so on.

All in all, though, this is actually quite a nice solution.

Dave.
-- 
Dave Ewart
[email protected]
Computing Manager, Cancer Epidemiology Unit
Cancer Research UK / Oxford University
PGP: CC70 1883 BD92 E665 B840 118B 6E94 2CFD 694D E370
Get key from http://www.ceu.ox.ac.uk/~davee/davee-ceu-ox-ac-uk.asc
N 51.7518, W 1.2016
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index