microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.34k stars 28.91k forks source link

New terminal lines rendering cuts off bottom/top of characters like underscore #35901

Closed viktorku closed 4 years ago

viktorku commented 7 years ago

The new terminal rendering cuts off the bottom part of "long" characters, such as g, j and y.

1.17.0: image

1.17.1: image

Steps to Reproduce:

  1. Open the Terminal
  2. Start typing git checkout -b feature/object

Reproduces without extensions: Yes

fpauser commented 7 years ago

Same problem here.

ghost commented 7 years ago

similar to #35794 but on fedora it cuts off the top part

masonj5n commented 7 years ago

Chops the top off on Fedora 26. badterminal

imgss commented 7 years ago

Same problem here.

ivcosla commented 7 years ago

I just changed the "terminal.integrated.fontFamily" value. My issue was that underscores were not displayed using DejaVu Sans Mono. With other fonts they are displaying, not sure if it would help to fix your problem guys, but sure is worth to give it a try.

jashworth commented 7 years ago

The variable width font that I'm partial to now renders like this.

image

Tyriar commented 7 years ago

@imgss see https://github.com/Microsoft/vscode/issues/35660 @jashworth see https://github.com/Microsoft/vscode/issues/35681

Tyriar commented 7 years ago

@viktorku what's in your settings.json file?

viktorku commented 7 years ago

In 1.17.1 the rendering changed (it's somewhat blurrier and smaller fontsize - see top comment for comparison) but the bug prevails:

image

@Tyriar This also happens for a fresh code instance (without settings.json in the project's root .vscode). My User Settings are like this:

{
    "workbench.sideBar.location": "left",
    "files.exclude": {
        "**/.git*": false,
        "**/.svn": true,
        "**/.hg": true,
        "**/.DS_Store": true,
        "**/.tags*": true,
    "**/.pyc": true,
        ".catkin_tools/**/packages": true,
        "build": true,
        "devel": true,
        "logs": true,
        "src/external": true,
        "**/CMakeLists.txt.user": true,
        "**/__pycache__": true
    },

    "editor.fontSize": 12,
    "editor.tabSize": 2,
    "editor.wordWrap": "on",
    "editor.rulers": [
        100
    ],

    "[python]": {
        "editor.tabSize": 4
    },

    "files.trimTrailingWhitespace": true,
    "diffEditor.ignoreTrimWhitespace": false,

    "workbench.editor.enablePreviewFromQuickOpen": false,

    "window.zoomLevel": 0,

    "clang-format.executable": "/usr/bin/clang-format-3.8",
    "clang-format.style": "Google",
    "clang-format.language.javascript.enable": false,

    "prettier.printWidth": 100,
    "prettier.singleQuote": true,
    "prettier.bracketSpacing": true,
    "workbench.colorTheme": "One Dark Pro",

    "editor.multiCursorModifier": "alt",
    "git.ignoreLegacyWarning": true,
    "workbench.startupEditor": "newUntitledFile",

    "eslint.nodePath": "/home/viktor/.nvm/versions/node/v7.4.0/bin/node",

    "python.linting.pylintArgs": [
        "--load-plugins pylint-django"
    ]
}
mpartipilo commented 6 years ago

Similar issue. Image here: https://github.com/Microsoft/vscode/issues/36322#issuecomment-337618385

Tyriar commented 6 years ago

Using the insiders build I believe you can workaround this currently by setting:

"terminal.integrated.lineHeight": 1.1
CoenraadS commented 6 years ago

@Tyriar

The line height workaround doesn't work for me in latest insiders

Running Ubuntu in virtualbox

In my screenshot I typed some underscores _________ image

I also tried crazy heights like 2 but nothing seems to help

This is a regression from 1.17 where it displays fine: image

Setting terminal.integrated.fontSize": 13 is a workaround for me

simon387 commented 6 years ago

yeah, fixed on fedora26 VSC 1.17.2 Shell 1.7.7 with the terminal.integrated.fontSize option

DannyMexen commented 6 years ago

Ubuntu 17.10 here and terminal.integrated.fontSize solved it. Thanks, everyone.

suonto commented 6 years ago

Added "window.zoomLevel": -0.001 for workaround on fedora26 VSCode 18.1

apojomovsky commented 6 years ago

Thanks @suonto , it worked on my Ubuntu 16.04 VSCode 18.1 as well.

mpartipilo commented 6 years ago

Confirmed @suonto's fix works on Debian Stretch VSCode 18.1. Also, it looks much better with "terminal.integrated.lineHeight": 1.2

Jeyanthinath commented 6 years ago

Oops , This issue also came into stable build

Version 1.18.1
Commit 929bacba01ef658b873545e26034d1a8067445e9
eightbitraptor commented 6 years ago

Yup. This is broken for me:

[mattvh@hitomi] ~ % cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=17.04
DISTRIB_CODENAME=zesty
DISTRIB_DESCRIPTION="Ubuntu 17.04"
[mattvh@hitomi] ~ % code --version
1.18.1
929bacba01ef658b873545e26034d1a8067445e9

Can confirm that adjusting terminal font size works as a workaround.

kbumsik commented 6 years ago

I came from #38133. Underscores are missing in my terminal too.

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=17.10
DISTRIB_CODENAME=artful
DISTRIB_DESCRIPTION="Ubuntu 17.10"
$ code --version
1.18.1
929bacba01ef658b873545e26034d1a8067445e9
mauvehed commented 6 years ago

Setting "terminal.integrated.fontSize" to 13 or 15 (default for me was 14) resolved the issue of invisible underscores in my integrated terminal.

Tyriar commented 6 years ago

Upstream issue: https://github.com/xtermjs/xterm.js/issues/1138

logannc commented 6 years ago

Changing fonts can also help. Using Hack which is very, very similar to the default fixed it for me.

fabiuz commented 6 years ago

In the Visual Code Settings is: "terminal.integrated.fontFamily" : "" "terminal.integrated.fontSize" : "14"

// Controls the font family. "editor.fontFamily": "'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'",

// Controls the font size in pixels. "editor.fontSize": 14,

If I use the default settings, the character _ is not displayed. But, If I change the value of "terminal.integrated.fontSize" for a value diferent of 14, the character is displayed.

And, I noticed, other detail, if I not change "terminal.integrated.fontSize" but "terminal.integrated.fontFamily" for other font, independently of value in "terminal.integrated.fontSize", is charactere _ is displayed.

leejroberts commented 6 years ago

In Ubuntu 16.04, changing the terminal font family to a different Ubuntu font fixed the problem. "terminal.integrated.fontFamily": "Ubuntu mono".

sombriks commented 6 years ago

using "terminal.integrated.fontSize": 13 or "terminal.integrated.fontSize": 15 did the trick for me. only fontSize: 14 shows the problem. quite curious.

rumpelsepp commented 6 years ago

Can confirm what @sombriks says.

sombriks commented 6 years ago

also "terminal.integrated.fontFamily": "Courier" instead of font size solved the problem here.

fabiuz commented 6 years ago

If I use the default settings, the character _ is not displayed. But, If I change the value of "terminal.integrated.fontSize" for a value diferent of 14, the character is displayed.

And, I noticed, other detail, if I not change "terminal.integrated.fontSize" but "terminal.integrated.fontFamily" for other font, independently of value in "terminal.integrated.fontSize", is charactere _ is displayed.

certik commented 6 years ago

There are two ways to fix this in Ubuntu (I tested this in 16.04, 17.10 and 18.04):

  1. Put this into your settings:

    "window.zoomLevel": -0.001,

    That seems to fix the problem with the original vscode font.

  2. Put this into your settings:

    "terminal.integrated.fontSize": 16,
    "terminal.integrated.fontFamily": "Ubuntu mono",

    This will use the same font as in the gnome-terminal in Ubuntu, and the size will be the same as in the original vscode font, so if you are already used to the font size in the vscode terminal, it doesn't change. If you want the same size as in the Ubuntu gnome-terminal window, use size 18.

P.S. I posted this in https://github.com/Microsoft/vscode/issues/46900#issuecomment-377741221, but that issue is closed, and whenever I get on a new computer, I have to google how to fix this issue, so by posting here, it's easy to find the workaround for Ubuntu, until this gets fixed.

plembo commented 6 years ago

On Ubuntu 16.04 with Unity 7 desktop and VSCode 1.22.2, found that all of the Linux defaults for editor.fontFamily (which are inherited by the terminal with the default "" setting for terminal.integrated.fontFamily) result in this terminal behavior. Changing the terminal font to 'Liberation Mono' or 'Noto Mono' in user settings worked for me, but I think the "window.zoomLevel" fix is probably the least intrusive solution.

caub commented 6 years ago

On Lubuntu 18.04 2018-05-31-022537_816x79_scrot with

    "terminal.integrated.fontSize": 16,
    "terminal.integrated.fontFamily": "Ubuntu mono",

2018-05-31-022859_800x59_scrot

I preferred the font before though

"window.zoomLevel": -0.001, is same as before

I'll go with "terminal.integrated.fontSize": 15, // or 13

zeljkoantich commented 6 years ago

Thanks @leejroberts "terminal.integrated.fontFamily": "Ubuntu mono", "terminal.integrated.fontSize": 16,

Or one of this two: "terminal.integrated.fontFamily": "Liberation Mono" "terminal.integrated.fontFamily": "Noto Mono", thanks @plembo

hkiang01 commented 6 years ago

This is also present in version 1.25.0 (Ubuntu 18.04).

The following solution (originally posted here) works:

In settings.xml

 "window.zoomLevel": -0.001,
mattwelke commented 6 years ago

This issue is affecting me on 1.25.0 on Antergos.

All of the fixes mentioned here, including setting window.zoomLevel to -0.001 and increasing line height were unable to fix it for me with my default fault. Only using other zoom levels with ctrl+ and ctrl- or changing fonts worked for me. My workaround was to change fonts to Courier family.

sguillia commented 6 years ago

Is there going to be any fix for this ?

I think characters in the integrated terminal (eg. underscores) should be displayed without the user having to tweak the settings. A freshly installed VS Code should not suffer from this bug.

fessmage commented 6 years ago

+1 vote for fix this problem once and for all. I googled this thread for fix with every fresh install of VS Code.

shivakumargn commented 6 years ago

The fix that worked best for me is "window.zoomLevel": 0.001 (+ or - non-zero value close to zero seems to work fine)

IMBurbank commented 6 years ago

For those who can't get these font size/type solutions to work - make sure you check in a new terminal window. The changes won't be reflected in any currently open terminals.

ryanQL commented 6 years ago

@suonto zoom level fix works! I'm using Fedora 28 and VSCode 1.27.1

Tyriar commented 6 years ago

A temporary workaround was merged for Ubuntu that tweaks the font family/size if it's not set https://github.com/Microsoft/vscode/pull/56429

machta commented 6 years ago

Another possible workaround is changing the terminal renderer like this. Then it seems you don't need to change the font size. I use this on Mint 19 MATE in VirtualBox.

"terminal.integrated.rendererType": "dom"
praenubilus commented 6 years ago

Ununtu 18.04 with zsh, having the same problem.

vladipus commented 5 years ago

Linux Mint 19. What an upsetting bug. That undescore invisibility just renders the terminal un-usable

arufian commented 5 years ago

in my case, you just have to zoom in your screen with [Shift] + [Cmd] + [;] (for mac), [Shift] + [Ctrl] + [;] (for windows)

zaro commented 5 years ago

Happens for me also on Fedora 29 with vscode 1.30.2

kylegmaxwell commented 5 years ago

Same here, also on Fedora 29 with vscode 1.30.2 @machta's solution worked for me, not sure what the drawbacks of that render mode are.

"terminal.integrated.rendererType": "dom"
mattwelke commented 5 years ago

@kylegmaxwell I remember a while back the devs switched from DOM to canvas for the integrated terminal. Their inspiration was speed. I believe this means switching back to DOM renderer type would fix the regression but be slower in some situations.

https://code.visualstudio.com/docs/editor/integrated-terminal#_changing-how-the-terminal-is-rendered

Tyriar commented 5 years ago

Yes the DOM renderer will be slower, we have improved it a bit recently so you should probably use that if you hit this cut off issue.

I put together a renderer using WebGL a while ago which fixes this problem and is much faster than the canvas one as well, need to find some time to stabilize and get it into VS Code though. https://github.com/xtermjs/xterm.js/pull/1790

mmhelm commented 5 years ago

I fixed the issue by removing 'monospace' from editor.fontFamily in settings.json (or Settings > Text Editor > Font > Font Family):

# Broken: "Hello_World!" -> "Hello World!"
"editor.fontFamily": "'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'"

# Works: "Hello_World!" -> "Hello_World!"
"editor.fontFamily": "'Droid Sans Mono', monospace, 'Droid Sans Fallback'"

Neither of the other fixes above worked for me.