URL: <https://savannah.gnu.org/bugs/?63581>
Summary: Intermediate output on sample_docs.mom causes terminal to hang Project: GNU troff Submitter: preciouschicken Submitted: Tue 27 Dec 2022 03:48:55 PM UTC Category: Macro mom Severity: 3 - Normal Item Group: Crash/Unresponsive Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any Planned Release: None _______________________________________________________ Follow-up Comments: ------------------------------------------------------- Date: Tue 27 Dec 2022 03:48:55 PM UTC By: Gene <preciouschicken> == Groff Version: == GNU groff version 1.22.4 GNU grops (groff) version 1.22.4 GNU troff (groff) version 1.22.4 == Platform: == Linux MyLinuxBox 5.4.228-1-MANJARO #1 SMP PREEMPT Mon Dec 19 13:16:06 UTC 2022 x86_64 GNU/Linux == Configuration Report: == Name : groff Version : 1.22.4-7 Description : GNU troff text-formatting system URL : https://www.gnu.org/software/groff/groff.html Licences : GPL Repository : core Installed Size : 9.8 MB Groups : base-devel Depends On : perl gcc-libs Optional Dependencies : netpbm: for use together with man -H command interaction in browsers [Installed] psutils: for use together with man -H command interaction in browsers libxaw: for gxditview [Installed] perl-file-homedir: for use with glilypond Required By : man-db Optional For : -- Provides : -- Replaces : -- Conflicts With : -- Packager : Andreas Radke <andy...@archlinux.org> Build Date : Tue 29 Mar 2022 22:05:12 BST Install Date : Fri 15 Apr 2022 17:50:43 BST Install Reason : Installed as a dependency for another package Validated By : Signature Backup files : -- == Input Files: == 'sample_docs.mom' file included in the repository == Command Line: == Run the following commands: curl https://git.savannah.gnu.org/cgit/groff.git/plain/contrib/mom/examples/sample_docs.mom --output sample_docs.mom groff -m mom -Z -T utf8 sample_docs.mom == Description Of Incorrect Behaviour: == Groff prints to standard output, but then the terminal hangs. An interrupt, ^C, is then required to return the terminal to the user. To my mind this is incorrect behaviour on two counts: 1. A document that exists solely to act as a 'sample' should run without causing the terminal to hang (unless there is an intentional error, which I couldn't see). 2. On a deeper level it would be preferred if groff could exit in these circumstances with an error code, rather than simply causing standard output to hang. NB The sample_docs.mom file self-identifies as UTF8. Running the file without the '-T utf8' generates no errors. == Additional Comments: == I am new(ish) to Groff, so it might be that this is expected / required / in some way useful behaviour. Of course if this is the case then grateful for education. As background I'm raising this bug as it impacts on a vim plugin I've written (https://preciouschicken.com/software/vim-groff-viewer/). One function of the plugin is to determine a word count for the document (obviously only counting printed words rather than macro commands). There were a number of ways to achieve this, but the method that seemed to work best was using groff intermediate output. I tried that on a number of test files and it worked well - until I came to 'sample_docs.mom' which causes my plugin to hang... _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?63581> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/