Bug 2099282

Summary: tcsh manual page does not document the maximum line size in the history file
Product: Red Hat Enterprise Linux 8 Reporter: Carlos Santos <casantos>
Component: tcshAssignee: Lukáš Nykrýn <lnykryn>
Status: NEW --- QA Contact: Karel Volný <kvolny>
Severity: low Docs Contact:
Priority: low    
Version: 8.6CC: fkrska
Target Milestone: rcKeywords: Documentation
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Carlos Santos 2022-06-20 12:50:52 UTC
Description of problem:

csh does not load a corrupted history file, showing this error messge:

   Can't load history: $< line too long.

This behavior is expected, although the leading "$< " is annoying, but the
maximum line size in the history file is not documented, which may confuse
the user.

Version-Release number of selected component (if applicable):

tcsh-6.18.01-17.el7_9.1.x86_64

How reproducible: always.

Steps to Reproduce: not applicable.

Actual results: the manual page does not document the maximum line size in
the history file.

Expected results: the manual page should document the maximum line size in
the history file.

Additional info:

The maximum line length is hard-coded in sh.lex.c:

$ fgrep -n -B1 -e TOOLONG tcsh-6.18.01/sh.lex.c
188-	if (enterhist && toolong++ > 10 * 1024)
189:	    stderror(ERR_LTOOLONG);
--
306-    if (enterhist && toolong++ > 256 * 1024)
307:	stderror(ERR_WTOOLONG);
--
366-	if (enterhist && toolong++ > 256 * 1024)
367:	    stderror(ERR_WTOOLONG);

So they are 256k characters in a word (including the leading space/newline)
and 10k works in a line.

The same behavior (and lack of documentation) is seen on RHEL 8 and RHEL 9,
this bug may be just cloned accordingly, if it's not considered severe enough
to be fixed on RHEL 7.