Bug 2099282 - tcsh manual page does not document the maximum line size in the history file
Summary: tcsh manual page does not document the maximum line size in the history file
Keywords:
Status: NEW
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: tcsh
Version: 8.6
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Lukáš Nykrýn
QA Contact: Karel Volný
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-06-20 12:50 UTC by Carlos Santos
Modified: 2023-07-10 12:49 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-125757 0 None None None 2022-06-20 12:59:19 UTC

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.


Note You need to log in before you can comment on or make changes to this bug.