question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dynamically update options(width)

See original GitHub issue

I noticed that no matter the size of the R console in Visual Studio code the options("width") always returns the default 80. Is there a way to dynamically adjust options("width") based on the size of the R console in VScode as it is done in Rstudio?

PS: I am hoping that this is the right place for this issue

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
renkun-kencommented, Feb 10, 2020

On Linux and macOS, environment variable COLUMNS should be useful.

Using

options(width = as.integer(Sys.getenv("COLUMNS")))

could set R terminal width to full terminal width.

On Windows, I’m not if there’s a way to do this.

If you need automatic adjustment, you could add the following code to your ~/.Rprofile:

addTaskCallback(function(...) {
  options(width = as.integer(Sys.getenv("COLUMNS")))
  TRUE
})

It will update the width after each top-level user input.

1reaction
renkun-kencommented, Feb 10, 2020

@intiben Glad to know it works for you. Closing now. Please feel free to reopen if you encounter further problems.

Read more comments on GitHub >

github_iconTop Results From Across the Web

jquery select 2 change dropdown width dynamically
I'm using jquery select 2 and need to reduce width of dropdown dynamically. This is my code,
Read more >
Have width change dynamically in accordance to ... - Syncfusion
Hello,. I currently understand the width of the dropdown control is based on the parent container, so it is a fixed width.
Read more >
Dynamically setting width of a container | OutSystems
The first JS will get the width of element JobInput.id and will update the label and display correctly the width of 542. This...
Read more >
HTML <select> with dynamic size - Jonas Fährmann
The size (width) problem​​ The Designer often describes only one state of the Element with the initial option selected and a fixed width,...
Read more >
Dynamically update options in a select component
Hi Team,. I have the code snippet below wherein I'm dynamically populating and selecting options in a select component. Both objectives work, but...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found