Hi, Mike Gran <spk...@yahoo.com> writes:
>> From:Mark H Weaver <m...@netris.org> > >> >> Mark wrote: >> > It seems to me that *width* should not be a global variable, but rather >> > a per-repl setting. It probably belongs in the options field of the >> > <repl> record, no? See "repl-default-options" in >> repl/common.scm. [...] > How common is the use case where REPLs for a single Guile session appear > in terminals of different width? Think of ‘--listen’. >> Mark also wrote: >> Better yet, maybe it should be an optional attribute of the output port, >> which would allow pretty-print and truncated-print to use it as well. >> Output ports attached to terminals could determine the terminal width >> from the OS, on systems that support it. I like the idea of using the terminal’s width, but I dislike the idea of having it a property of the port, since it really seems orthogonal to me. > [...] If one wanted to have a port automatically > query its terminal for the width, one could either (IIRC) catch the SIGWINCH > signalor could call a getenv/tget function before printing a pretty-print or > truncated-print. How about having a per-REPL setting that’s automatically set to the terminal’s width by default? What’s the exact call to get the width? Thanks, Ludo’.