Where does win32 python command prompt history happen?

David Broadwell anti-spam.dbroadwell at mindspring.com
Fri May 16 00:06:55 EDT 2003


"Tim Roberts" <timr at probo.com> wrote in message
> >>in win9x days one had to enably doskey in the auotexec.bat file to get
this.
> >>afaik, at least since win2k, this has been part of the command prompt.
I
> >>doubt it is in the kernel, but it is part of windows.
> >
> >I don't think it's part of windows while it's in the Python
> >interactive console.
>
> Why not?  Python gets its input by reading from stdin.  As soon as it
reads
> from stdin, the process is under the control of Windows.  As far as I
know,
> the original poster is correct: doskey maintains this history
> automatically.
>
> >IIRC it's part of the readline library.
>
> It is on the Linux-like systems, but I didn't think gnu readline was part
> of Python on Windows.
>
> Plus, it doesn't answer the original question "where is the history
> stored"?

Ug, i was loathe to mention it because i no longer have my old dos refrences
on hand, but if i rememebr correctly the history (as of old doykey, not it's
new countrerpart), was kept in the environment on a per boot basis. Yet
there were configs for 'shortcut' commands there were resident in the
autoecex.bat!

Ok, in short; I believe it's a dos environment variable.

I haven't been THAT hard core into dos in ... at least 8 years! When i
finally upgraded from dos to windows 95.

The sad thing is, it still answers to doskey, and attached is the doskey /?
which is about as close as i think we get to 'documents' on it these days.

$p$g> doskey /?
Edits command lines, recalls Windows 2000 commands, and creates macros.

DOSKEY [/REINSTALL] [/LISTSIZE=size] [/MACROS[:ALL | :exename]]
  [/HISTORY] [/INSERT | /OVERSTRIKE] [/EXENAME=exename]
[/MACROFILE=filename]
  [macroname=[text]]

  /REINSTALL          Installs a new copy of Doskey.
  /LISTSIZE=size      Sets size of command history buffer.
  /MACROS             Displays all Doskey macros.
  /MACROS:ALL         Displays all Doskey macros for all executables which
have
                      Doskey macros.
  /MACROS:exename     Displays all Doskey macros for the given executable.
  /HISTORY            Displays all commands stored in memory.
  /INSERT             Specifies that new text you type is inserted in old
text.
  /OVERSTRIKE         Specifies that new text overwrites old text.
  /EXENAME=exename    Specifies the executable.
  /MACROFILE=filename Specifies a file of macros to install.
  macroname           Specifies a name for a macro you create.
  text                Specifies commands you want to record.

UP and DOWN ARROWS recall commands; ESC clears command line; F7 displays
command history; ALT+F7 clears command history; F8 searches command
history; F9 selects a command by number; ALT+F10 clears macro definitions.

The following are some special codes in Doskey macro definitions:
$T     Command separator.  Allows multiple commands in a macro.
$1-$9  Batch parameters.  Equivalent to %1-%9 in batch programs.
$*     Symbol replaced by everything following macro name on command line.

--

David Broadwell






More information about the Python-list mailing list