Xterm 日志文件名的资源名称

Xterm 日志文件名的资源名称

Xterm 支持以下命令行选项:

-lf filename                 logging filename

为了指定.Xdefaults文件中的文件名,该选项的资源名称是什么?

答案1

要看的地方是在xterm 手册,其中说

   -l      Turn logging on, unless disabled by the logInhibit resource.

           Some versions of xterm may have logging enabled.  However,
           normally logging is not supported, due to security concerns in
           the early 1990s.  That was a problem in X11R4 xterm (1989)
           which was addressed by a patch to X11R5 late in 1993.  X11R6
           included these fixes.  The older version (when running with
           root privilege) would create the log-file using root privilege.
           The reason why xterm ran with root privileges was to open
           pseudo-terminals.  Those privileges are now needed only on very
           old systems: Unix98 pseudo-terminals made the BSD scheme
           unnecessary.

           Unless overridden by the -lf option or the logFile resource:

           o   The logfile is written to the directory from which xterm is
               invoked.

           o   The filename is generated, of the form

                   XtermLog.XXXXXX

               or

                   Xterm.log.hostname.yyyy.mm.dd.hh.mm.ss.XXXXXX

               depending on how xterm was built.

和(对于人们建筑xterm,例如,用于包装)INSTALL文件解释了相关的配置脚本选项:

--enable-logging 启用日志记录

    Compile-in code that allows logging.

    Logging was disabled in X11R5 xterm because of security problems.
    They were addressed in X11R6, but the feature was not reinstated.

X11R6 已发布 20 年前,您不太可能使用 xterm 的 X11R5 版本。

然而...手册页没有提及相关资源。为此,您必须阅读源代码,从资源表

#ifdef ALLOWLOGGING
    Bres(XtNlogInhibit, XtCLogInhibit, misc.logInhibit, False),
    Bres(XtNlogging, XtCLogging, misc.log_on, False),
    Sres(XtNlogFile, XtCLogfile, screen.logfile, NULL),
#endif

即存在三个相关资源,logInhibit,记录logFile。最后一个允许用户指定日志文件的名称,该名称将覆盖生成的名称。

我总是编译该功能,以供偶尔测试。 Debian 软件包启用了它,而 Fedora 软件包则没有(有些打包者阅读了说明,有些则没有)。

原因为什么默认情况下不打开该功能的原因与最多默认情况下,功能不会打开:这对于使用该程序来说不是必需的。大多数新功能都带有默认的“关闭”设置。该规则的最新例外发生在 2014 年,添加了--disable-wide-attr配置选项。

答案2

在过去的美好时光我使用了资源

XTerm*VT100.logFile

然而,出于安全考虑,现在 xterm 通常编译时没有此功能,因此这可能没有效果。

相关内容