On Sat, 23 May 2026 22:15:53 -0500
David Wright <[email protected]> wrote:
> On Sat 23 May 2026 at 13:31:38 (+0000), Roger Marsh wrote:
> > On Fri, 22 May 2026 10:12:40 -0400 Greg Wooledge wrote:
> > > It's the *output* of script, though it could have been mangled during
> > > email tranmission.
> > >
> > > If the log hasn't been mangled, then simply "cat"ing it on a compatible
> > > terminal should leave the terminal in some sort of state resembling
> > > what the OP saw on their terminal while recording the session. However,
> > > there's a non-zero security risk in doing this (some terminal emulators
> > > may execute commands when given certain escape sequences), so I would
> > > not advise it.
>
> When I read you first post, I copied the body to a file and edited all
> the Esc chars to · so that the less output wasn't ablaze with inverse
> video. I then edited some of the commonest escape sequences to tiny
> characters so that I could see the wood for the trees.
>
> I don't know what terminal wine thinks you have, but it sure has fun.
> Sequences like ·[?25h·[?25l·[?25l·[?25h·[?25l·[?25l·[?25h·[?25l are
> VT220 commands to show and hide the cursor.
According to printenv, and 'set' at the 'wine cmd>' prompt, it must be xterm
(from TERM=xterm). After checking with 'man xterm' I guess VT220 is a good
bet. The outputs in my first post were on an almost default graphical install:
network is manual not DCHP and desktop is Xfce. I am building another box
tailored to what I want: manual network, just SSH server and Standard system
utilities during installation, plus wine64 and wine32:i386 added later so far.
(64-bit Python cannot be installed on Wine without wine32:i386 being present.)
printenv gives TERM=linux and 'wine cmd>set' gives TERM=xterm on this box.
>
> As you type the letters, the cursor is jumping back and forth between
> the start and end of the line. There are many Clear-to-end-of-line
> occurrences, most of which are at the end of the typing so far.
>
> There are many colour commands, required to keep the >>> prompt
> magenta, import blue, and exit cyan.
>
> Anyway, with zapping the sequences in turn, there was little enough
> left to do any damage, so I've attached a pasted cat of your attached
> version, lacking the colours. (I've added a .txt.)
>
> > The script *output* included in the body of the first email,
> > wine-python-debian, is attached. It was collected with a monitor,
> > keyboard, and trackball, connected to the Debian box and all input was via
> > the keyboard with trackball focusing assistance. No ssh into the Debian
> > box in other words. It seemed to me the 'cat' interpretation of the script
> > output file did not accurately represent what was seen on the terminal as
> > the characters were being typed. Specifically all of the '>>>' lines
> > displayed except those terminated by a typed-in 'Enter' looked blank in
> > part with the input cursor at an apparently random position on the latest
> > line.
>
> Your output contains sporadic ^M (CR) characters, and I think all of
> them cause a line feed, which means that you see the line printed
> as far as you have typed at this point. (I haven't looked hard
> enough to check whether your typing was perfect or included
> corrections.)
>
> Some of the ^M chars cause the Esc to be missing from the following
> escape sequence, which is why there are fragments of them printed at
> the start of five lines. I don't know why this should be happening.
>
> Just to check my copy is good, here's its MD5 digest:
> 52bd7b55a5d579ae6b9dfee8d3e52fd8 /tmp/wine-python-debian
>
> > The script *output* attached as wine-python-openbsd-xserver shows what
> > happens with the 'import subprocess' statement in
> > a Microsoft Windows 'py -3.14' session, a Debian 'wine python' session, and
> > a Debian 'wine cmd python' session. The 'pythonw' command is accepted in
> > wine but does nothing visible.
> >
> > OpenBSD 'less' translates the 'square with four things in it' symbol as ESC
> > in both attachments.
>
> Your first post starts: "The script shows, after preamble for
> Debian and Wine versions, what happens on typing … …", but you
> don't actually state what you observed when you were originally
> typing the commands yourself, after typing the script command.
> Did the output look normal as you typed it?
>
Short answer: no
Long answer is a bit like a Shipping Forecast:
My typing and response starting from the '>>>' prompt:
'>>>' always magenta
insertion point for next character typed is immediately after last of same line
and next line '...' unless stated otherwise.
'i' same line '>>> i' next line ' '
'm' same line '>>> im'
'p' same line '25h>>> im' next line ' imp '
'o' same line '>>> impo'
'r' same line '>>> impo' next line '>>> impor'
't' same line '>>> impor' next line 'mport ' "mport" blue
' ' same line '>>> import' next line ' ' "import" blue
's' same line '>>> import s' "import" blue
'u' same line '>>> import s' next line '>>> import su' "import" blue
'b' same line '>>> import su' next line '>>> import sub' "import" blue
'p' same line '13D>>> import sub' next line '>> import subp ' "import" blue
">>" magenta
'r' same line '>>> mport subp' next line 'import subpr ' "mport" blue
"import" blue
'o' same line '>>> import subpr' next line 'o subpro ' "import" blue
"o" blue
'c' same line '>>> import su' next line 'bproc ' "import" blue
'e' same line '>>> import subproce' next line ' ' "import"
blue
's' same line '[19D>>> import subproces' next line ' '
"import" blue
's' same line '[?25h>>> import subprocess' next line ' '
"import" blue
'\n' same line '' next line '>>> '
'e' same line '>>> e' next line ' '
'x' same line '>>> ex'
'i' same line '25h>>> ex' next line ' exi '
't' same line '>>> exit' insertion point at right-most column of session "exit"
cyan
'(' same line '>>> exit' next line '>>> exit(' "exit" cyan
')' same line '>>> exit(' next line '>>> exit()' "exit" cyan
'\n' same line '[9D>>> exit()' next line '' "exit" cyan
The Python session was run by:
$ ssh debian
...
roger@debian:~$ wine python
so it was next to the email session on the monitor for ease of describing the
changes seen.
I made lots of typing mistakes on the way to this. If I just accepted the
SyntaxError, or whatever, and started typing the example again the "same line"
"next line" patterns could be different.
> I don't use wine, but here's a run from my system: a cut-and-paste
> of the original typing, the typescript, and the replay from cat.
> (Note that my bash prompt updates xterm's window title with the
> hostname and pseudoTTY number.)
What I see for python3 (native debian) is like your cat replay, and identical
for the Python prompts.
>
> Cheers,
> David.
I have probably seen Python's magenta '>>>' prompts on Wimdows before but not
taken much notice till now. Installing several older Python versions on Wine
shows that the magenta '>>>' prompt first appears in 3.13 and older versions do
not have this problem.
Thanks,
Roger