Reputation: 629
I'm using Visual Studio Code 1.18.1 on Mac OSX and the integrated terminal seems to have a fixed width of 36 characters that doesn't increase when I make the terminal window wider.
How can change the number of characters per line in the terminal? Is it possible to make the lines wrap based on the terminal window width?
Upvotes: 17
Views: 19218
Reputation: 1329712
There is no option to disable word-wrap in VS Code integrated terminal
Actually, for VSCode 1.61 (Sept. 2021), there is:
Terminal / Toggle wrapped lines:
Toggle the terminal width between fitting the full contents and wrapped lines via
kb(workbench.action.terminal.sizeToContentWidth)
or using the tab context menu actionToggle Size
toContent Width
.
Keyboard shortcut: Alt+Z
Upvotes: 8
Reputation: 408
There is no option to disable word-wrap in VS Code integrated terminal, but you can set an external terminal via "console": "externalTerminal"
and there disable the word wrap or set the line width.
For example: On Windows click on top left corner to see the menu and select Properties, then Layout and uncheck the buffer checkbox and then increase the buffer to 4000.
On Linux try setterm -linewrap off
Upvotes: 1
Reputation: 3558
UPDATE 1: As of now there is no option to disable word-wrap in VS Code integrated terminal ( internally running program like bash
or zsh
will get the same width as the vscode terminal area you can check with echo "COLUMNS=$COLUMNS"
) even popular terminal emulator like iTerm don't have this feature see this open issue #1790
now if you can not do this at vscode level you can try doing it on program lever ( like bash
or zsh
) maybe there is some way by defining a setting in bashrc
or zshrc
but I can not find anything on internet
However there is a program which can make horizontal scroll available for you at program level and that is less -S
you can pipe any output ( with help of |
oprator ) in it like
echo " this is very long lorem ipsum text sldkfjdslfk jsdlfkj sldfkj sldfkj sdlfjs dlfkjsd flsd jfsdlkfsdlfkj slfkjs lflskdfjsldfjsdlfksdlfkjsdflksdjflsdkfj ssldfkjsdlkf jsdlfkj sdlfsjdlfksdf lsdfjk " | less -S
you can scroll horizontally with help of arrow key for more shortcut see
h H Display help.
q :q Q :Q ZZ Exit.
I am using version 1.42.1
and it works as expected maybe you can try updating it to the latest version
I also checked the configuration ( command + ,
) there wasn't any setting related to width of the integrated terminal
Upvotes: 1
Reputation: 194
There doesn't seem to be a fix to this currently per open issue: https://github.com/microsoft/vscode/issues/74501
However in the above issue, user ultraGentle recommends tput rmam
as a workaround.
Upvotes: 1