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.

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?

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.)

Cheers,
David.
axis 08:51:47 ~$ cat /tmp/wine-python-debian 
Script started on 2026-05-21 19:56:52+01:00 [TERM="xterm-256color" 
TTY="/dev/pts/0" COLUMNS="80" LINES="24"]
roger@debian:~$ uname -a
Linux debian 6.12.74+deb13+1-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.74-2 
(2026-03-08) x86_64 GNU/Linux
roger@debian:~$ wine --version
wine-10.0 (Debian 10.0~repack-6)
roger@debian:~$ wine python
Python 3.14.2 (tags/v3.14.2:df79316, Dec  5 2025, 17:18:21) [MSC v.1944 64 bit (
AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> i
25h>>> im
>>> impo
>>> impor
>>> import
>>> import s
>>> import su
13D>>> import sub
>>> mport subp
>>> import subpr
>>> import su
>>> import subproce
[19D>>> import subproces
[?25h>>> import subprocess

>>> e
25h>>> ex
>>> exit
>>> exit(
>>> exit()

roger@debian:~$ exit
exit

Script done on 2026-05-21 19:58:33+01:00 [COMMAND_EXIT_CODE="0"]
axis 19:31:15 ~$ 
axis 21:09:17 ~$ scrip my-typescript.txt
Script started, output log file is 'my-typescript.txt'.
axis 21:35:25 ~$ python3
Python 3.9.2 (default, May 14 2026, 03:00:00) 
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import subprocess
>>> exit()
axis 21:35:51 ~$ exit
exit
Script done.
axis 21:35:54 ~$ 
Script started on 2026-05-23 21:35:25-05:00 [TERM="xterm-256color" 
TTY="/dev/pts/10" COLUMNS="100" LINES="33"]
]0;AXIS          /dev/pts/23          AXIS[?2004haxis 
21:35:25 ~$ python3
[?2004l
Python 3.9.2 (default, May 14 2026, 03:00:00) 
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import subprocess
>>> exit()
]0;AXIS          /dev/pts/23          AXIS[?2004haxis 
21:35:51 ~$ exit
[?2004l
exit

Script done on 2026-05-23 21:35:54-05:00 [COMMAND_EXIT_CODE="0"]
axis 21:46:20 ~$ cat /tmp/my-typescript.txt 
Script started on 2026-05-23 21:35:25-05:00 [TERM="xterm-256color" 
TTY="/dev/pts/10" COLUMNS="100" LINES="33"]
axis 21:35:25 ~$ python3
Python 3.9.2 (default, May 14 2026, 03:00:00) 
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import subprocess
>>> exit()
axis 21:35:51 ~$ exit
exit

Script done on 2026-05-23 21:35:54-05:00 [COMMAND_EXIT_CODE="0"]
axis 21:46:31 ~$ 

Reply via email to