microsoft / vscode

Visual Studio Code

Home Page:https://code.visualstudio.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

viktorku opened this issue · comments

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

  • VSCode Version: 1.17.0
Version 1.17.0
Commit be377c0faf7574a59f84940f593a6849f12e4de7
Date 2017-10-04T23:33:45.303Z
Shell 1.7.7
Renderer 58.0.3029.110
Node 7.9.0
Architecture x64
  • OS Version: Ubuntu Trusty 14.04

Steps to Reproduce:

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

Reproduces without extensions: Yes

Same problem here.

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

Chops the top off on Fedora 26.
badterminal

commented

Same problem here.

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.

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

image

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

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"
    ]
}

Similar issue. Image here: #36322 (comment)

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

"terminal.integrated.lineHeight": 1.1

@Tyriar

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

Running Ubuntu in virtualbox

  • VSCode Version: Code - Insiders 1.18.0-insider (81cca6c, 2017-10-31T06:24:27.011Z)
  • OS Version: Linux x64 4.10.0-37-generic

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

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

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

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

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

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

Oops , This issue also came into stable build

Version 1.18.1
Commit 929bacba01ef658b873545e26034d1a8067445e9

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.

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

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

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

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.

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

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

Can confirm what @sombriks says.

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

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.

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 #46900 (comment), 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.

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.

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

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

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,

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.

commented

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.

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

commented

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

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.

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

A temporary workaround was merged for Ubuntu that tweaks the font family/size if it's not set #56429

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"
commented

Ununtu 18.04 with zsh, having the same problem.

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

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

Happens for me also on Fedora 29 with vscode 1.30.2

commented

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"

@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

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. xtermjs/xterm.js#1790

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.

@mmhelm

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

I think this is a bad choise of possible workaround, because by disabling monospace fonts you will have broken pseudo-graphic user interface in various console utilities.

You should really try to calculate working value of terminal.integrated.fontSize for your case.

@fessmage He only removed the 's

@fessmage The broken config contains two monospace entries. One with quotation marks ('monospace') and one without (monospace). I just removed the entry with quotation marks.

When you remove both monospace entries, you're right ... the terminal gets pretty messed up ;-)

@mmhelm Right, i see it now, sorry.

Also i discovered that in my case, on Ubuntu, i needed no more to declare this settings for correct terminal font:

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

because after merging this PR, vscode sets this automatically.

Using this setting solved the issue for me (fedora 29), whatever the integrated terminal font size:

"terminal.integrated.fontFamily": "monospace"

Can confirm this as well. Removing 'monospace' (=with quotation marks) resolves the issue.

Using this setting solved the issue for me (fedora 29), whatever the integrated terminal font size:

"terminal.integrated.fontFamily": "monospace"

This did not solve the issue for me. I'm also using Fedora 29.
I used to use the zoomlevel = 0.001 workaround, but that does not work either anymore...

@mikkancso
What did the trick for me on Fedora 29 was to set the font family to :

"terminal.integrated.fontFamily": "Liberation Mono" 

@mikkancso
Try with the font weight:

 "terminal.integrated.fontWeight": "600",
 "terminal.integrated.fontWeightBold": "600"

Also i discovered that in my case, on Ubuntu, i needed no more to declare this settings for correct terminal font:

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

because after merging this PR, vscode sets this automatically.

After 1.33.0 its broken, again..

Fall back to manually setting terminal font size and family on Ubuntu 18.04 for fixing underscores.

"terminal.integrated.fontFamily": "Liberation Mono"

Also works on Ubunty 18.04.

Only add "window.zoomLevel": 0.001

@Tyriar

La solución de la altura de la línea no funciona para mí en los últimos conocedores

Ejecutando Ubuntu en virtualbox

  • Versión VSCode: Código - Insiders 1.18.0-insider ( 81cca6c , 2017-10-31T06: 24: 27.011Z)
  • Versión del SO: Linux x64 4.10.0-37-genérico

En mi captura de pantalla escribí algunos guiones bajos _________
imagen

También probé alturas locas como, 2pero nada parece ayudar.

Esta es una regresión de 1.17 donde se muestra bien:
imagen

El ajuste terminal.integrated.fontSize": 13es una solución para mí

Font weight fixed it for me on Ubuntu 18.04

Excuse me, but I disagree that these fontWeight and fontSize fixes and circumventions are reasons for closing this issue. It remains as being annoying and unpolished, now either I'm gonna have smaller characters or an overwhelmingly bright terminal. This is a major visual bug of VS Code and should be addressed as such.

EDIT

Oh, by the way, I forgot to mention that the underscore issue also happens inside the Jupyter Notebook interactive version terminal of VS Code. I don't know if by solving the issue of the main terminal will also solve that one.

Excuse me, but I disagree that these fontWeight and fontSize fixes and circumventions are reasons for closing this issue

The issue won't be closed until it's fixed.

I've gotten used to this in the terminal since this issue was originally reported, but today I just noticed that it is affecting other aspects of VS Code as well like the renaming symbol interface. Demonstration:

underscore_isse

@Welkie I think that's this one #46879, I suspect it's the same underlying cause that _ in Linux fonts sometimes go out of their expected bounds at least when drawn in Chromium, the fix would look different though.

@Welkie please comment on #46879 what OS/distro you're on and also whether or not the problem shows up in the intellisense completions as well like in the original post of that issue.

@Tyriar Looks like I can't comment on #46879 because it's locked. If it's unlocked, I'll leave a detailed comment with all the relevant info.

Unlocked, meant to when I reopened

@Tyriar Left a detailed comment.

setting "terminal.integrated.fontSize" to 15 shows the underscore character for me.

setting "terminal.integrated.fontSize" to 15 shows the underscore character for me.

It does not make sense to show only in higher font size, we need to fix it. But good to know the value, it could help debug.

Any progress on this issue?

Any progress on this issue?

None, continue the problem. :/

On Linux (Mint 19.2) installing the Inconsolata font and making it the first in the font list (and restarting VS Code) fixed the terminal window issue for me. I know that's not a "fix" but for those reading this thread who want a font "That Just Works" maybe that will help until it is fixed. FWIW, Linux Mint's editor, Xed, has had a similar issue - linuxmint/xed#39.

commented

I have the same problem
Reproduce: echo "___" into terminal

Workaround for me is in the settings:
"terminal.integrated.fontFamily": "monospace"

Version: 1.37.1
Commit: f06011a
Datum: 2019-08-15T16:17:25.463Z
Electron: 4.2.7
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
Betriebssystem: Linux x64 4.15.0-60-generic

Same issue here on Ubuntu 18.04 and latest (1.38.0) Visual Studio code. "terminal.integrated.fontFamily": "monospace" provides a good workaround, but a fix would be very appreciated :/

Version: 1.38.0
Commit: 3db7e09
Date: 2019-09-03T21:51:09.716Z
Electron: 4.2.10
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Linux x64 4.15.0-60-generic

Simply setting terminal font to Hack on Kubuntu 18.04 fixed it for me.
"terminal.integrated.fontFamily": "Hack"

When gets this fixed? It's a issue from 2 years ago already!
I don't understand why it's not a priority.

Setting: terminal.integrated.fontSize to 15 fixed the issue.
Maybe, make this font size the default? This could be an option.

commented

I work a lot in a linux environment compared to windows environment so when changing over from windows, I always get irritated that I cant see the underscores and I see that this has been going on for two years already. Commenting so I can follow this issue to see it fixed.

I'm not using vscode, but I'm seeing this issue on ArchLinux in both Chromium and Hexchat with certain font-sizes only, but not only with DejaVu Sans Mono (Book) but also with Noto Sans Mono but way less visible. Tested for chars: qpjy_. With Noto the underscore is always visible, but other chars can be seen cut off a bit.

Inconsolata(and/or Nimbus Mono PS too) font however seems to exhibit no such issues. Hence why I'm switching my Monospace font to it.

$ fc-match monospace
Inconsolata-Regular.ttf: "Inconsolata" "Regular"

This here is an interesting read as to why this descenders cut off might be happening.
Another interesting comment with some workarounds possibly.

Setting font size to 13.9 (from the default of 14) fixed underscores for me.

The current thing blocking this is stabilizing the WebGL renderer, see upstream query: https://github.com/xtermjs/xterm.js/issues?q=is%3Aopen+is%3Aissue+label%3Aarea%2Faddon%2Fwebgl

@Tyriar

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

Running Ubuntu in virtualbox

  • VSCode Version: Code - Insiders 1.18.0-insider (81cca6c, 2017-10-31T06:24:27.011Z)
  • OS Version: Linux x64 4.10.0-37-generic

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

fontSize: 13 and fontSize: 15 all can solve this problem. just advise that the default Size not be 14, it will be solved.

Underscores are finally visible with fontSize: 14 and the latest 1.40 version 🎉

@surges
Underscores are finally visible with fontSize: 14 and the latest 1.40 version

Still not working for me on: Ubuntu 18.04.3 LTS x64, VS Code 1.40

I have to use the workaround "terminal.integrated.fontSize": 15" in order to see the underscore.

@viniciussp4 I use my docker image with ubuntu 18.04 for development and I see the underscores:
https://github.com/Bessonov/dev-image

Can you check your installation and vscode settings or the image?
https://github.com/Bessonov/dev-image/blob/master/Dockerfile#L28

I mean, if it's working in a reproducible way with docker, then it could be a local problem.

image

@Tyriar

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

Running Ubuntu in virtualbox

  • VSCode Version: Code - Insiders 1.18.0-insider (81cca6c, 2017-10-31T06:24:27.011Z)
  • OS Version: Linux x64 4.10.0-37-generic

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

I don't get it but only the with font-size of 14 there comes the problem, but with other font sizes it not the case. Any reason ??

It's an off by one error in measuring the "height" of the font that doesn't happen in all font sizes in the canvas renderer of xterm.js. If there is someway to fix up this computation then that would fix this for the canvas renderer. I think there was an issue in xterm.js where I explained my investigation of this.

The issue is that rows are clipped so that we can render rows independently, otherwise the whole terminal would need an update. #84440 fixes this and makes the terminal way faster so stay tuned 😃

I'm running OSX and I used to have "ProggyCleanTTSZ" ( from the amazing https://proggyfonts.net/ ) and it worked like a charm.

One day i decided to accept the "Update" on VS Code and that terrible update started cropping my text on the terminal.

I played with all settings possible here in this thread and nothing worked other than changing my font to "monospace", which is less than ideal as i'm used to use ProggyClean for over 15 years now 😢

I hope this get fixed before i move back to vim, which perhaps i should never have left, lol

@hems that's a bug in Chromium that shows up on some fonts #84432, https://bugs.chromium.org/p/chromium/issues/detail?id=1026254

@hems that's a bug in Chromium that shows up on some fonts #84432, https://bugs.chromium.org/p/chromium/issues/detail?id=1026254

hopefully fixed soon

You can try out the new WebGL-based renderer where this issue is fixed by using this:

"terminal.integrated.rendererType": "experimentalWebgl"

It's available in Insiders and in the upcoming version.

The canvas renderer will eventually be removed as the webgl one is basically a highly optimized/low-level version of it.

"terminal.integrated.rendererType": "experimentalWebgl"

that just gave me new problems, like my text is rendered out of the Terminal box sometimes and i can't see it. but if i type for instance ls -la then i can se the result because it spans many lines.

@hems I haven't heard of a problem like that before, please report in a new issues with repro steps.

If you're still on the canvas renderer, @hems calls out a workaround in #107942 (comment) to regenerate the font file:

After months and months having the issue with my font being cropped on the bottom of the terminal i managed to solve the issue by importing the font into https://www.glyphrstudio.com/online/ then export it as OTF.