17

I installed ubuntu from the minimalcd because I just want to use vim and command line tools.

However I would like more than 80 columns of text. I have a large monitor so I would like at least a couple hundred columns so I can split panes in vim and have several windows open.

BTW ubuntu is installed as a VMWare Player VM. I have already verified that the VM settings are for a large monitor; it seems that my ubuntu setup is at issue.

4 Answers4

11

The following command:

docker exec -e COLUMNS="`tput cols`" -e LINES="`tput lines`" -ti container bash

works under most, if not all circumstances.

Fabby
  • 35,017
7

The variable $COLUMNS specifies how wide the terminal session is; so running COLUMNS=200 would make it 200 columns wide.

If you wanted to change that permanently you should put this in your ~/.bashrc file which is run every time you start a terminal.

jackweirdy
  • 3,520
  • 5
  • 27
  • 42
4

I met about the same situation and the above answer was just what I was needed.

But in your case, here are some hints if you are still interested:

Execute: echo $COLUMNS. In my case is was 141. By manipulating with export COLUMNS=XXX I was indeed been able to adjust the columns amount.

And this 141 number comes from the next. My .bashrc file contains the next code:

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

I don't know for sure, but pretty much seems like using shopt command Ubuntu detects my screen resolution and sets the according number of terminal columns. Again, setting export COLUMNS=XXX allows me to change this number for the current terminal window.

So in your particular case, you would have to add export COLUMNS=200 after the quoted shopt -s checkwinsize or at the very end of .bashrc.

3

Just make the terminal larger with your mouse and type:

sudo resize

:-)

Marc
  • 349
  • 1
  • 7