Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

script(1): Enable proper playback [-p] of curses sessions #433

Closed
wants to merge 1 commit into from

Conversation

8vasu
Copy link

@8vasu 8vasu commented Jul 30, 2020

The current manpage of script(1) says the following.

Certain interactive commands, such as vi(1), create garbage in the typescript file. The script utility works best with commands that do not manipulate the screen. The results are meant to emulate a hardcopy terminal, not an addressable one.

script(1) is currently able to record [-r] curses sessions perfectly; only the playback functionality [-p] has the above restriction; this patch removes this restriction by appropriately setting terminal attributes.

@8vasu
Copy link
Author

8vasu commented Jul 31, 2020

Additional notes:

  • I used https://github.com/iiSeymour/game-of-life to reproduce the problem; authored by GitHub user iiSeymour, this, in the words of the author, is "a python implementation of Conway's Game of Life using the curses module with a small evolutionary twist"; it was written for Linux; therefore, one must call "python gol.py" on FreeBSD to bypass the "#!".

  • This is a duplicate of https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=248377, which was also created by me. This was done to maximize the chances of getting noticed. If the patch on Bugzilla is accepted, I will close this pull request, and vice versa.

  • I submitted a similar patch for "scriptreplay(1)" from util-linux; it has now been merged by the maintainer of the project.

@8vasu 8vasu changed the title script(1): Enable proper curses playback [-p] capability script(1): Enable proper playback [-p] of curses sessions Jul 31, 2020
@8vasu 8vasu closed this Jul 31, 2020
@8vasu 8vasu reopened this Jul 31, 2020
@8vasu
Copy link
Author

8vasu commented Aug 2, 2020

Further info:

  • To reproduce the problem, please run the script(1) session in a terminal that does not have post processing turned off.

  • NetBSD has accepted a similar patch. They modified it slightly: they call atexit(termreset) instead of the several termreset() calls that are present in this patch. While not necessary, upon request, I can edit this patch to reflect that change.

@8vasu
Copy link
Author

8vasu commented Aug 2, 2020

Patch was updated with atexit(termreset) instead of multiple calls of termreset.

@8vasu
Copy link
Author

8vasu commented Aug 7, 2020

Now I am comfortable with FreeBSD Bugzilla. Closing.

@8vasu 8vasu closed this Aug 7, 2020
hardenedbsd-services pushed a commit to HardenedBSD/hardenedBSD that referenced this pull request Feb 10, 2023
* export netbsd's reallocarr proposal.

acts subtly differently from reallocarray, returns an error code
and first argument as receiver.

* not export by default

* ci tests

* apply suggestions

* doc addition

* Apply suggestions from code review

Co-authored-by: Matthew Parkinson <mjp41@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant