zsh-users
 help / color / mirror / code / Atom feed
* gnu script and zsh: only log command output
@ 2022-05-12 18:45 chiasa.men
  2022-05-13 19:12 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: chiasa.men @ 2022-05-12 18:45 UTC (permalink / raw)
  To: zsh-users

When I use "script --log-output o --log-input i" I am facing two problems:

1: The output log contains the actual input: e.g. ".]0;test@test: echo 5.5"
(see below)
2: The prompts

I really just want the programs output logged - no prompts, no shell-related
output.

Is that possible?

Actually Im using a python script with "pid, master_fd = pty.fork();
pty._copy(master_fd, _my_read_function, _my_stdin_read_function)"

So would there be a way to reliably filter the zsh-related output e.g. within
the _my_read_function function?

Example logs:
output:
> .[1m.[7m%.[27m.[1m.[0m
>
> .]0;test@test: ~/script.
> .[0m.[27m.[24m.[J.[1m.[31m.[39m.[0m.[1m.[34mtest.[39m.[0m@test .[1m~/script
.[0m% .[K.[?1h.=.[?2004he.echo 5.[?1l.>.[?2004l
>
> .]0;test@test: echo 5.5
> .[1m.[7m%.[27m.[1m.[0m
>
> .]0;test@test: ~/script.
> .[0m.[27m.[24m.[J.[1m.[31m.[39m.[0m.[1m.[34mtest.[39m.[0m@test .[1m~/script
.[0m% .[K.[?1h.=.[?2004he.exit.[?1l.>.[?2004l
>
> .]0;test@test: exit.

input:
> echo 5
> exit







^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-13 19:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-12 18:45 gnu script and zsh: only log command output chiasa.men
2022-05-13 19:12 ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).