script(1) improvement

2020-08-01 Thread Soumendra Ganguly
Hello, OpenBSD! I am using script(1) to complement a program that I am writing. However, the current OpenBSD version of script(1) is very old [ based on NetBSD script(1) version 1.3 ]. It does not have the [-r] and [-p] options that the current NetBSD version [ 1.21 ] does. FreeBSD's script(

Re: script(1) improvement

2020-08-01 Thread Theo de Raadt
Soumendra Ganguly wrote: > Hello, OpenBSD! >I am using script(1) to complement a program that I am writing. > However, the current OpenBSD version of script(1) is very old [ based > on NetBSD script(1) version 1.3 ]. First off, it is not old. We don't automatically grab changes from com

Re: script(1) improvement

2020-08-01 Thread Soumendra Ganguly
Theo, Thank you for the feedback. I can understand why some of that functionality might be unnecessary if one only needs a hard copy of the terminal session. That is why [-r], [-p] are not applied by default. My patch for NetBSD script(1) has been accepted now. I will submit a PR to OpenBSD soo

Re: script(1) improvement

2020-08-02 Thread Stuart Henderson
What does the replay feature actually do? Does it re-enter the commands or just display the console output (like "cat typescript", but slower)? On 2020/08/01 22:23, Soumendra Ganguly wrote: > Theo, >Thank you for the feedback. I can understand why some of that > functionality might be unneces

Re: script(1) improvement

2020-08-02 Thread Soumendra Ganguly
Stuart, Sorry. I should have clarified. It does not re-enter the commands. If [-r] is used, then extra timing information is recorded into the typescript file, which can later be used by [-p] to replay the session [ like a video ] on the terminal. The patch to which I was referring enables prope

Re: script(1) improvement

2020-08-04 Thread Soumendra Ganguly
Theo, The replay feature does not make script(1) re-enter the commands. It simply replays them on the terminal as if it were a video [ like "cat typescript" but slower ]. It is particularly useful if someone wants to replay [ not re-run ] a curses session [ such as a game or an editing sessio

Re: script(1) improvement

2020-08-04 Thread Theo de Raadt
Soumendra Ganguly wrote: > Theo, > The replay feature does not make script(1) re-enter the > commands. It simply replays them on the terminal as if it were a video > [ like "cat typescript" but slower ]. It is particularly useful if > someone wants to replay [ not re-run ] a curses session

Re: script(1) improvement

2020-08-09 Thread Stefan Hagen
Soumendra Ganguly wrote: > It is particularly useful if someone wants to replay [ not re-run ] a > curses session [ such as a game or an editing session on vi ]. Have you tried textproc/asciinema? $ asciinema rec demo.cast # do something ncurses or not; stop with ctrl+d $ asciinema play demo.cas

Re: script(1) improvement

2020-08-09 Thread Soumendra Ganguly
Stefan, I had heard about asciinema before [ https://intoli.com/blog/terminal-recorders/ mentions a ton of other terminal recorders ]. asciinema is great. I had not heard about textproc before. Thank you very much for the information! My original intention was to know HOW these programs rec

Re: script(1) improvement

2020-08-09 Thread Soumendra Ganguly
I am trying to make my own code better + shorter + more portable. If/when anyone has time, can you please explain the following to me so that I do not make embarrassing claims like the one that I made on the other patch thread? :D Revision 1.33 of script(1) changes (void)tcgetattr(STDIN_FILENO, &

Re: script(1) improvement

2020-08-09 Thread Soumendra Ganguly
Raf, Aah. Got it. I thought textproc was a separate program [ n00b ]. Sadly, I am only running OpenBSD in a vm currently to examine the code of script(1). I truly appreciate the fact that you clarified this. Soumendra On 8/9/20, Raf Czlonka wrote: > On Sun, Aug 09, 2020 at 10:07:47AM BST, So

Re: script(1) improvement

2020-08-10 Thread Theo de Raadt
Soumendra Ganguly wrote: > based on the fact that tty operations should not be performed on stdin > if it is not a tty [ maybe it is a regular file ]. This observation > was made by bl...@openbsd.org. I claim that only > > if (tcgetattr(STDIN_FILENO, &tt) == 0 && >

Re: script(1) improvement

2020-08-10 Thread Soumendra Ganguly
Yes. You are correct. In the back of my mind, I did want to leave a small mark [ OCD ]. However, I was also trying to justify removing, from my own code, all isatty instances that are immediately followed by tcgetattr [ again, OCD ]. The fact that I understood the isatty situation correctly is val

Re: script(1) improvement

2020-08-25 Thread Soumendra Ganguly
Sir, The statements I had made earlier about tcsetattr failures in openpty are all false; since the pty slave is always a tty, ENOTTY failures won't happen. However... I have been experimenting on linux, and while trying to make the openbsd code work there [ since it is shorter ], I discovered t