7 ms·
Integrated Terminal Performance Improvements
- FBISurveillance 9y agoObligatory comment: I really like VSCode but keep jumping back and forth between it and Sublime because of startup time. I like VSCode enough to use it daily and extensively and jump back to sublime when I need to jump around projects fast–when startup time becomes crucial. I believe they will solve this issue at some point.
- ch4s3 9y agoI think they can probably improve, but just due to being built on chromium means a level of overhead that's likely higher than sublime. If fix means acceptably close, they might get there. I'm now using VSCode daily and have no real complaints.
- Waterluvian 9y agoBy startup do you mean the initial loading of VSCode or the cost of switching project contexts within VSCode? I wonder if you can just pre-load Code and hide it in some manner plus use CLI commands to open new folders/files within the existing VSCode instance rather than a new one? I do agree, though. VSCode has so many benefits but every so often I hit an irregular usage where I'm opening lots of various stuff and its a bit slow.
- lobster_johnson 9y agoWhile VSCode is great, it's also useless as $EDITOR. It's very slow to start (when it's already running), and while you'd think you could speed this up by making it open a new tab in your current window and and return control the parent process when you close that tab ("code -r -w", I believe), that's not possible. It can open the new tab, but it never relinquishes control, at least not for me. Wouldn't be an issue if startup was super fast with "code -w", but creating new windows, even when VSCode is running, takes several seconds. So I still use "joe" as $EDITOR.
- Tyriar 9y ago> and while you'd think you could speed this up by making it open a new tab in your current window and and return control the parent process when you close that tab ("code -r -w", I believe), that's not possible. Exactly this is actually coming in v1.17.
- lobster_johnson 9y agoAwesome. Of course, fast window startup would be even better.
- jordache 9y agoWhy are they focusing on this when there is a huge usability problem on osx + high res displays
- KayL 9y agoI'm using a macbook pro and it seems fine. Is the text blurry on 4k/5k?
- FBISurveillance 9y agoI own LG Ultrafine 5K; when I work with VS Code full screen it blinks like framerate is 10fps or something. Otherwise it works OK on MacBook screen.
- reljac 9y agoI'm running a Touch Bar MBP connected to the LG UltraFine 5K with no visible problems FullScreen or not on the LG panel. Resolution is set for "Default for display" and I run Flux. Initially I had some issues with the monitor that went away when I got a new USB-C cable. Perhaps that would help...?
- Tyriar 9y agoAuthor of the blog post here. Canvas works fine for HDPI screens, you just need to handle it by tweaking the size of the canvas element (in CSS pixels, .style.width) and the number of actual pixels in the canvas (.width).
- Zaskoda 9y agoI'm on Linux, but I actually chose VS Code over Sublime 2 because I switched to an HD display. Sublime 2 does not scale tabs (or at least it didn't when I switched) which drove me nuts. I didn't expect to like VS Code but I do. I like it a lot, especially for going to and from different display resolutions.
- batmansmk 9y agoYou should file an issue, as we have no problem here on macOS 10.12 and high resolution displays. 20 developers using this setup.
- polskibus 9y agoThat's great! Does anyone know if the code editor itself uses canvas rendering? If not then why?
- altano 9y agoIt doesn’t use canvas
- copperx 9y agoHaving never looked at the source, I'm curious about how you build an editor using web technologies. Is it just a big textarea that gets manipulated with JS?
- simlevesque 9y agoIt's not one large textarea. There is a textarea which is 1x1 and right next to the cursor. I have no idea what they are for. Just open the dev tools and have some fun. You'll learn a lot.
- lobster_johnson 9y agoThe textarea is to accept input, presumably. It's a trick often used in a normal browser HTML page, too. You get focus, keypresses, copy/paste, etc. via the native browser UI. It's a shame that HTML doesn't provide something similar, but as a hack it's not too bad.
- simlevesque 9y agoThe other comment is wrong. I opened the DevTools inside vscode and executed 'document.getElementsByTagName("canvas")'. In a single editor group[1] in edit mode there are two canvases. One is for the overview over the scroll bar. The second is the minimap. When you are in diff mode there are two more canvases to show the diff on the right side. [1] https://code.visualstudio.com/docs/getstarted/userinterface#_editor-groups https://code.visualstudio.com/docs/getstarted/userinterface#...
- w0utert 9y agoI really wish Microsoft had used a different platform to build VS code on, like C#/Mono, Java, anything except Javascript/Electron basically. I just started using VS code for C++ development, trying to switch from Vim, an I basically like everything about the concept, but the execution and quality/polish of the software is mediocre at best. At least three times a day random stuff breaks: code completion stops working, switching between header/source (using a plugin) stops working, all keyboard input except shortcuts stops working, Vim plugin acting up, the app randomly starts to use 40% cpu until I kill it etc. On top of that performance is just so-so for most things (editing, autocomplete), and quite slow for others (e.g. gotoSymbol for the whole project). This was very disappointing for me to find out considering all the praise VS code gets for being ‘probably the best Electron app’. I don’t mean this as a flame, but the software just feels like all the other applications I tried that are based on web technology. If it works everything is fine, but if you stress the application enough, inevitably things start to fail in ways that suggest it was simply too difficult to properly QA and test the thing to the point it doesn’t hit some weird platform edge case. I sincerely think the product itself is awesome, apparently that’s enough for people to put up with the shoddy stability and general sense of quality? Maybe there are other reasons and the platform is not actually the problem, but I find it remarkable that something as advanced as VS code fails in similar ways my own web-based projects usually fail. And now I read they are going to implement their own console rendering using HTML canvas, because the obvious ways to implement it when you are stuck with a Electron have major shortcomings... Somehow I just feel Microsoft with all their talent and resources could have made an even more impressive product if they had made the exact same thing based on some other platform...
- CJefferson 9y agoSomething is seriously wrong with your setup. I know many vscode users, and none of them are having your problems. I'm not saying you aren't having real problems, but they aren't common and they can appear in any editor -- I used to fill vim with plugins and it would hang frequently.
- thebestia29 9y agovery good clarification the truth I liked your article, I would love to learn more of this world of technology as a trend to niverl worldwide and develop web pages and develop applications that allow us to go forward and know more about what is new IA
- dy 9y agoLove the integrated terminal in VS Code! Great work by the team on this and appreciate the writeup. Curious what keyboard shortcut people use to move focus from editors to the Terminal and create new terminals? Anyone use tmux inside terminal?
- Tyriar 9y agoAuthor of the blog post here. The standard shortcuts are ctrl+` for toggling the panel and ctrl+shift+` for creating a new terminal. This is what I use on top of that: { "key": "ctrl+`", "command": "workbench.action.terminal.focus", "when": "!terminalFocus" } This will focus the terminal if the focus is anywhere else, if the terminal is focused it will close it. You can add this one if you want ctrl+` to only toggle focus between the terminal and the last editor: { "key": "ctrl+`", "command": "workbench.action.focusActiveEditorGroup", "when": "terminalFocus" } On tmux, Joao from the team did a write up on configuring persistent sessions in the terminal using tmux https://medium.com/@joaomoreno/persistent-terminal-sessions-in-vs-code-8fc469ed6b41 https://medium.com/@joaomoreno/persistent-terminal-sessions-...
- lobster_johnson 9y agoLast I checked, this only makes sense on US keyboards. On most non-US keyboards, the backtick requires option/alt and isn't practical as a shortcut.
- anontrot 9y agoI think you could just add a custom keybinding now that you know the commands.
- chillee 9y agoA big thing that I use is that if you do quick open (`ctrl+p`) and then type `term `, you can then type the terminal number to go to the specified terminal.
- jamesgeck0 9y agoI added the following to my keybindings.json file. It changes ctrl+` behavior to toggle open/close the terminal. ``` { "key": "ctrl+`", "command": "workbench.action.terminal.focus", "when": "!terminalFocus" } ```
- revelation 9y agoThat is pretty concerning if they have to drop down to what is essentially a slightly improved framebuffer to get acceptable performance for a terminal emulator. The Electron waters are shallow and when you jump in head first you might hit a performance wall sooner than your feet hit the water. I predict that by 2020 they'll have migrated the editor and terminal emulator to an OpenGL surface.
- WorldMaker 9y agoOr maybe you just underestimate the demands of a terminal emulator? More specifically, the demands of many users of a terminal emulator. People want to try to see the matrix, they want 60fps scrolls full of arcane details too quick to actually be useful, but clear enough to kind of skim to give the impression that it may be useful. VSCode isn't the first terminal emulator to use a videogame canvas renderer approach (by decades), and won't be the last. (Not just because the work was PRed to a shared library that other applications use too, but also because there will always be people trying to see the matrix in terminal emulators as long as there are terminals to emulate.)
- revelation 9y agoThat was done because it was the only method available or because they started out with high performance / low latency / ... goals. Here is the VS Code team saying DOM performance was useless. And at the end of the day we're talking about 80x20 characters, sometimes color.
- WorldMaker 9y agoNo, the VS Code team is saying DOM performance isn't enough for the high performance / low latency demands they are seeing. The performance with DOM was already good enough for all my needs, personally. They had a lot of people wanting 60fps consoles, so they decided to take a 60fps approach, and even though it is "just" text/color/limited graphics, it shouldn't be a surprise that the 60fps approach is the same one they would take for a more graphics-focused approach somewhere else.
- 9y ago
- Waterluvian 9y agoWhat's the case for using the terminal in VSCode? I use a modern multitasking computer where VSCode is in one area or screen and my terminal in another (and other things in others). By using my own terminal I get to keep everything custom about that terminal rather than having another one. Surely there's reasons that I'm missing? Edit: thanks for all the responses. A lot of great new things I didn't think of before!
- nwrk 9y agoFor example, you can use linter in terminal which makes click on output messages interactive -> going directly to source code. edit: quick youtube example how it works together https://www.youtube.com/watch?v=cMrDePs86Uo https://www.youtube.com/watch?v=cMrDePs86Uo
- simlevesque 9y agoThis is a real time saver.
- lobster_johnson 9y agoWouldn't it be better to run the linter in the background and have the editor mark the problem lines? I have keyboard shortcuts bound to "next marker" and "previous marker" so I can jump to the next problem. They don't work across an entire workspace, sadly, and I have an outstanding Github issue about it that has not seen any activity for years. Project-wide linting is something that VSCode really lacks right now. For example, it's easy to change something in one file that breaks another file, but you won't get any error markers until you go to the broken file.
- jamesgeck0 9y ago> Wouldn't it be better to run the linter in the background and have the editor mark the problem lines? I have keyboard shortcuts bound to "next marker" and "previous marker" so I can jump to the next problem. The ESLint plugin does both these things; linting is just an example. I use the terminal's click-to-open file feature for opening files that have have merge conflicts during git rebase, and for opening spec files that failed. It's just handy to have.
- nwrk 9y agoExcited that terminal is getting love. Thanks team VSCode. Hope the configurable panels allowing terminal on right side will get merged soon. [0] https://github.com/Microsoft/vscode/pull/34267 https://github.com/Microsoft/vscode/pull/34267 [1] https://github.com/Microsoft/vscode/issues/2806 https://github.com/Microsoft/vscode/issues/2806
- koolba 9y ago> Misaligned characters: Due to many monospace fonts not being strictly monospace for some Unicode characters, this could lead to situations like the one seen on the right-side of the image below: (image) What are they referring to? I've been staring at the pic for nearly a minute and can't see anything misaligned.
- the_common_man 9y agohttps://github.com/sourcelair/xterm.js/pull/938 https://github.com/sourcelair/xterm.js/pull/938 is the PR does rendering using canvas
- helloimraghav 9y agoI'm an iOS Developer learning React, using Webstorm I can get all the auto completion + some other things I like from Xcode. Can I set up VS Code to do the same?
- styfle 9y agoI don't have experience with React Native, but certainly React + TypeScript gives you autocomplete in VsCode. Try cloning my repo here: https://github.com/styfle/react-server-example-tsx https://github.com/styfle/react-server-example-tsx
- anontrot 9y agoI've been using VSCode for a while. I have this one issue with it, I couldn't figure out how to switch between the Terminal & the editor. Often I just (CMD+ Tab) to go to an independent terminal and execute some command. The only way I could figure out to do this within VSCode is "Contrl + ~", but have to do it twice if it's already open. So, does any of you know if there's an easy way of switching between the editor and the terminal?
- theyregreat 9y agoAre there any macOS terminals like iTerm but with performance and resource efficiency as the top goals?
- unrealhoang 9y agoYou can try Alacritty
- jamesgeck0 9y agoAlacritty is extremely fast, but you need to use a terminal multiplexer like tmux or screen if you want commonly used features like tabs or scrolling. Which would be fine, except that both tmux and vim run significantly slower than expected in Alacritty on macOS; there's a performance bug somewhere.