Skip to content
Prev 366714 / 398502 Next

Current Terminal (console) width

The answer is UI-specific.

In the supplied-by-R-core Windows GUI for R, options("width") is the
current width of the command window.  If you run R in a cmd.exe window
instead of the GUI you can get the width of the cmd window by doing
some string manipulations on the output of shell("mode con",
intern=TRUE).  E.g.,
as.integer(sub("^.* ", "", grep(value=TRUE, "Columns:", shell("mode
con", intern=TRUE))))

(Setting options(width=120) when using the cmd window does not seem to
affect the input echoing - it seems to always be 80 characters.)
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Fri, Jan 20, 2017 at 8:17 AM, Jared Studyvin <jstudyvin at west-inc.com> wrote: