180 points · by lelf · 6y ago · 143 comments
ConEmu glitches out for me on tmux. Hyper can be a bit slow, but is most accurate for me.
I'm doing tmux + vim with 256 colors. So a lot of stuff has to come together and "just work"
Windows Terminal over the past months fixed glitches. It's update-able via Windows Store.
Oh, and the font "Cascadia Code" is one of my favorites. Very clean. Actually, I'm using it on Linux now in my terminal [1].
The other thing is Windows Terminal works great on a huge monitor, too. No lag when rendering. Feels lite. I compare its snappiness to rxvt-unicode. Faster than iTerm2.
Just my perception, never benchmarked.
And this goes along with WSL 2, which is worth reinstalling Win 10 for if you left because of WSL 1 problems. This stuff is fast. I can throw multiple multiple beefy node projects, python flask/django apps, building C++ projects, importing postgres DB (4gB import with a lot of indexes), all at the same time.
[1] I dual boot still. There is a shortcut on Windows 10 minimizes all windows that I can't disable easily. It loses my workspace positioning and isn't recoverable. I hope this gets changed - it'd be a dream.
Combined with the steady improvements to being able to access the Linux side from Windows (under \\wsl$\machine-name), and being able to mount that to a drive letter (I have my ~/.zprofile run `/mnt/c/WINDOWS/system32/subst.exe A: '\\wsl$\arch' > /dev/null`, which delays subsequent login shell startups by 30–40ms, but that’s not too bad), shifting all your relevant stuff onto the Linux side and still working with Windows tools where desirable is quite feasible.
I moved all my files (including a >700MB Git repository) from C: to A: after upgrading to WSL 2. Well worth it. I do most of my work in a terminal (the Linux side) or in gVim (the Windows side).
I also tried WSL 1 with Ubuntu and was hugely disappointed by the speed. Even a simle agt-get install would take forever.
WSL 2 improved the Linux filesystem speed A LOT. I think it's a sane approach:
* keep all your dev stuff in WSL (The Visual Studio Code "Remote - WSL" plugin is amazing!)
* use Windows for GUI tools only
Is IntelliJ IDEA able to detect file changes like this? Maybe share from Linux via CIFS?
I dual boot at home, but for work dual book isn't really the tool I need. What I want is to be able to use bash and the *nix tools I know best as an interface to the Windows-based projects I work on. I'm much faster navigating the FS, even the Windows FS, using bash commands than the nightmare that is cmd, and Powershell just feels like too much -- like Java in the shell. So WSL has been exactly what I need.
Working on projects within the Windows directories does feel slower, but I haven't noticed anything like 100x slowdowns. NPM installs are essentially the only part of my regular workflow that feels painful.
Also it lets me work on my pet roguelike project during slow meetings, but that's our little secret....
I recommend to check out the 16 million colors; Windows Terminal, tmux, and [neo]vim - all support it out of the box (assuming you use versions recent enough). See more at my infamous "truecolor" list[1]. Or an example[2] of such a condiguration.
Very true. I eventually gave up on that because some computers I use still have Windows 7, so it was just easier to use gVim, than mess with installing and configuring a terminal (and PTY?) too.
I tried AutoHotkey for the firs time yesterday. Am I correct in saying a text file has to be edited to disable the key? What would it look like?
I also heard about Win + D, which could be what I'm hitting a % of the time. Correct me if I'm wrong: but positioning any window after minimization (possibly including the bottom show-desktop / taskbar area) will make it so the window settings can't be reverse back?
My dream scenario would be something in Windows 10 settings where shortcuts can be remapped (or disabled) one-by-one, without registry/group policies.
1. Right-click on your desktop (or any other folder) and choose New -> AutoHotkey Script.
2. Name the file something like DisableMinimize.ahk.
3. Right-click the file and choose Edit Script; alternatively, open it in your text editor of choice.
4. Keep the existing text that's in the file, but add the following to the end:
#d::
return
#m::
return
This script will work just like a program. Double-click it to run it, or put it in your Startup folder. You can even right-click -> Compile Script to generate a standalone EXE.> I also heard about Win + D, which could be what I'm hitting a % of the time.
Both Win + D and Win + M seem like pretty obscure shortcuts to be hitting by accident. Some touchpads and mice have gestures or buttons that minimize all windows, though; in particular, on lower-quality laptops, I've found that the "minimize-everything-and-interrupt-whatever-I'm-doing" gesture likes to fire randomly. It even used to happen a lot on some older Surface devices. Is it possible that's the issue?
> Correct me if I'm wrong: but positioning any window after minimization (possibly including the bottom show-desktop / taskbar area) will make it so the window settings can't be reverse back?
You'll lose the memory of which windows were visible, but with both Win + M and Win + D, their positions and sizing should be preserved. If a window doesn't restore to its same position and sizing when you restore it, that's most likely a bug in the individual application.
https://github.com/lukeschlather/dotfiles/blob/master/src/au...
I actually rebind
#m:WinMaximize A (Win-M Maximize active window.)
One notable shortcoming is that you have to run Autohotkey as administrator if you want it to work perfectly. Otherwise if you have an active window with admin privileges the system hotkeys will reassert themselves. (I don't run it as admin, so this is a constant annoyance when I start an admin powershell prompt and try to maximize it.)
1. https://devblogs.microsoft.com/commandline/windows-command-l...
Maintaining compatibility and performance were two of the main unbreakable tenets of the team (and Windows in general). This made it difficult to move quickly with features right out of the gate. A few of those years were spent understanding the system and modernizing the code from crufty C to C++17, while still managing to add features.
One of the first dev tasks I heard about when I became exposed to the project was of a dev mapping out all of the PVOIDs in the codebase so they could be eventually replaced with better abstractions. Another fun one was a different dev that refactored the GDI rendering, as a side project squeezed in around other tasks. The new renderer ended up being much faster and ~7000 lines shorter, if I remember right. We also took CJK language support quite seriously, which was difficult as none of the devs could read one of those languages day to day to catch bugs quickly.
What was the last console improvement? Quick Select? Windows 2003? Mouse-resizable console windows had me salivating for Windows 10!
Are you sure? The command line and WSL folks only started being prominent a couple of years ago. Maybe I missed something?
The Console/Terminal team first took-ownership of the Console & Cmd codebases in late 2014, so it's been ~5.5 years.
Until v. recently, the team averaged ~2.5 devs and 0.5 PM (I had to split my time across Console and WSL).
Since spring 2019 when we began the effort to build Windows Terminal, we've grown the team to 4 devs and 1.25 PM (I am now the .25 since Terminal now has a dedicated PM).
During this time, we have shipped improvements to Console in every release of Win10, including transparent background, VT, 24-bit color, and many perf, stability, etc. fixes. But we can only do so much to the Console before we start to break users' existing systems, apps, and tools.
Since Console & Cmd's key responsibility is backward compat, we're pretty much leaving them alone.
But we're plowing ENORMOUS effort into building Windows Terminal which is shaping-up nicely for its v1.0 release this summer. Please give it a try and if you find problems, find/file issues in the github repo because, yes, Windows Terminal and Console are open-source!
I highly recommend to check out WSLtty if you're interested in a good WSL terminal: https://github.com/mintty/wsltty
It has equally as low input latency, really good keyboard shortcut support, clickable URLs, tmux works perfectly (with and without the mouse), it's rock solid, uses almost no resources, has smaller / less distracting window borders vs MS' terminal and it has lots of themes. I've been using it for full time development with tmux + terminal Vim for almost a year now and it hasn't failed me yet.
I wish they would hire the dude who makes WSLtty. It feels like the MS team doesn't want to address the really important things that make a terminal optimal for full time development. It's like they spent 3 years creating a tabbed interface and supporting icon emojis but ignored other critical features for so long (for the longest time you couldn't even zoom in and out with a hotkey).
I no longer work on the project but that team is filled with some of the most passionate and dedicated people you could find to shepherd the console from where it was to now. We collectively lived and breathed the console, yet the team was always understaffed and almost always had at least one dev that was pulled off by management to work on what was believed to be a higher priority project.
Implementing the emoji support took me years and that doesn't even count the rendering of them, just the ability to shuttle them through the internals and back. Tabs as well required quite a bit of work behind the scenes, there was an entire blog series written on the work that led up to tabs being possible.
I would've imagined this to be the case on Windows, at least for Metro apps — isn't that where the new GUI development is going on?
I'm probably way off-base, but it always seems like problems that should be solved system-wide on Windows are solved in different ways by different teams at different times.
Set-PSReadLineOption -EditMode Emacs
1: https://stackoverflow.com/questions/43295639/update-powershe... if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadLine
Set-PSReadLineOption -EditMode Emacs
Set-PSReadLineKeyHandler -Key 'Ctrl+V' -Function Paste
Set-PSReadLineKeyHandler -Key 'Ctrl+v' -Function Paste
Set-PSReadLineKeyHandler -Key 'Ctrl+/' -Function Undo
Set-PSReadLineKeyHandler -Key 'Ctrl+Backspace' -Function BackwardKillWord
Set-PSReadLineKeyHandler -Key 'Ctrl+LeftArrow' -Function BackwardWord
Set-PSReadLineKeyHandler -Key 'Ctrl+RightArrow' -Function ForwardWord
}Plus this was setup on my otherwise dedicated “gaming pc” with an i7 9700k and fast ram/storage so it’s nice being able to use all that power
To me this sounds less like an endorsement and more like "it is not strictly worse".
WSL 2 is probably an imperceptible difference for most tasks though since it's just a svelte Hyper-V VM.
Actually in those environments I've had success using Electron[1]. But well, that's electron...
* The biggest issue for me is that it's crashed 8 or 9 times. Most times when this happens I lose some long-running process I forgot to nohup. This is the first terminal I've had crash so regularly. There's also some link to the crashing and accessing it from remote desktop but I can't figure out the trigger.
* The memory usage seems to really jump up sometimes, I have over 2GB being used right now between my usual 5 or 6 tabs ssh'ed into other machines.
* It can get in a state where it pegs my cpu at 30%. I think this happens when it's spooling text faster than it can be output and it's trying to catch up. It doesn't happen all the time.
* copying text. The option to automatic copy on selection (similar to what I'm used to from gnome-terminal) is frustrating. If you select text, change window focus and copy something else, then refocus the terminal it'll re-copy the originally selected text!
I've tried ConEmu, Cmder, Cygwin, and Alacritty.
I've finally been able to retire my Cmder installation.
"padding": "10, 10, 10, 10"
I have it set to all 0s since it interferes with the emacs background color setting, so it might need a unit in there too.
Let me know if it works. Probably has a bunch of junk you won't need (like various custom color palettes I played around with). I may or may not have edited other .cmd files outside of the ConEmu.xml realm so that may warrant some tweaking too
And you'll need the Monaco Font (and Ubuntu Mono for the lambda) for it to look exactly the same
https://ilovepowershell.com/2011/11/03/list-of-top-powershel...
Did they just phrase this backwards or is that the total opposite of what you'd expect?
confirmFontSize = 12
?
Naming things is hard :)
[1] https://gist.github.com/XVilka/a0e49e1c65370ba11c17
I often like to run `cls; build -with -long -output;`. And then I scroll to the top to see the first build error. With this, when you issue a clear, it only blanks the visible viewport, and you can still scroll back through all the old stuff.
https://github.com/microsoft/terminal/issues/1305
There's a lot of information here that's over my head about how this actually isn't a bug, and different pieces of trivia and history. But I still can't use it for my use case, which is a thing I do often.
The Windows behaviour is correct, the Linux behaviour is inconsistent and was kept for historical reasons only.
Microsoft has been overrun with developers who think that whenever there's a conflict between the Windows and Linux ways of doing things, then automatically the Linux way is correct, because of a 60-year old UNIX legacy that must be preserved forever and ever. Even on different operating systems. Even in green-fields codebases being developed in 2020. Even if it makes no sense at all. Even if it's a regression compared to what Windows does now.
This is not the only example. Mark my words, it's just a matter of time until junior Microsoft devs reintroduce all of the stupidities from Linux that have no place in any sane operating system:
* Button action occurs on mouse-down instead of mouse-up, making misclicks uncancellable.
* No delete key support to match Linux backspace-only behaviour: https://unix.stackexchange.com/questions/66434/delete-key-do...
* Cursor key support is removed in favour of vim-style hjkl movement keys that make sense only on ADM-3A terminals from the 70s: https://superuser.com/a/599152
* Selection copies instantly, wiping out your clipboard whether you like it or not.
* All output becomes text, because strong typing is for soft people that haven't mastered sed/awk.
* PowerShell is replaced by bash, because why would anyone need consistent naming, readable scripts, and pervasive tab-complete? We want to save precious bytes on our 300 baud SSH connections!
* SSH for Windows instead of WinRM, which has been included for a decade.
And a "sane" operating system is independent of shells (whether *sh or PowerShell or cmd) and is also independent of the GUI running on it.
Button action is related to the GUI you're running, not Linux.
Delete key actions are related to termcap which indeed is historical. However, any sane GUI terminal handles that. How many people actually operate a windows machine via a serial port?
Cursor key support: I used terminals in the 70s and 80s. Many of them had arrow keys that were supported. See termcap above that was specifically to handle these sorts of issues.
Multiple clipboards, again, are dependent on your GUI, it has nothing to do with the terminal or the PTTY underneath it in Linux/Unix.
All output becomes text, is actually a misnomer. It is that all output (by default) comes out of stdout and is an octet stream.
SSH didn't exist when there were 300 (or 110) baud connections. TTYs did and devices like the VT-52 that supported certain escape sequences to do things that were relevant to a screen as opposed to a printer with keyboard attached.
SSH vs WinRM. Neither were around when the Unix TTY/PTTY/line drivers etc were established. In fact, telnet and rlogin weren't around either. They're not even comparable. SSH establishes an encrypted tunnel between processes, WinRM is a SOAP API client/server protocol for performing remote admin.
But hey, tell us what you think about systemd.
No, it is not. An operating system is not just a kernel. It's a collection of components, of which the kernel is just a tiny part. Windows is the combination of Win32, WMI, DCOM+, Active Directory, Registry, NTFS, GDI+, DirectX, and so on. Take away even a couple of those, and you no longer have Windows.
Applications are programmed not against the bare kernel API, but shims like Win32. Similarly, applications are programmed against the standard operating system shells. A Linux install script that requires "sh" will not "Just Work" on Windows. A program that requires CMD.EXE batch files will not "Just Work" on Linux, even if it could otherwise, such as a Java app.
That's just the APIs and shell languages. The GUIs are the same. That's the human interface to the OS. An Apple OSX app ported as-is to Windows (preserving the look & feel) would feel horribly out of place.
Other than the GUI, the only other human interface is the text shell. It's important. It's a significant chunk of the experience for advanced users. Directly porting Linux-isms to Windows is just as out-of-place as directly porting a Mac app to Windows.
> Button action is related to the GUI you're running, not Linux.
Switchable GUIs are an X-Windows thing. Most other operating systems, such as OSX and Windows have consistent GUI toolkits. Linux doesn't. Its arbitrary button click behaviour is insane. When your learned habit is to depress buttons for a second while thinking twice about potentially harmful actions, knowing that you can cancel by moving the cursor off and releasing, the outlier Linux behaviour is shocking in its indifference to 99% of the installed GUI base that existed at the time.
> Delete key actions are related to termcap which indeed is historical.
I still can't use the del key like... 50% of the time I interact with non-Windows operating systems, particularly over SSH. How is this still a problem in 2020!? Please explain why this has been simply unsolvable for all of this time. The 101-key layout has been out for 30 years. That's three decades. THREE!
> Cursor key support
I was being sarcastic at this point. However, you will still find people arguing with a straight face that ijkl movement is "superior", which is just hilarious.
> Multiple clipboards
Windows has one primary clipboard. One. It now has clipboard history, but I'm willing to bet that 99% of its user base is unaware of this feature. The standard for 99.99% of its apps is to not overwrite the clipboard on select, yet I've seen apps ported from Linux introduce this behaviour to have that "Linux feel".
This is just as wrong as porting the Mac OSX look and feel to Windows.
> All output becomes text, is actually a misnomer. It is that all output (by default) comes out of stdout and is an octet stream.
That's splitting hairs. Practically all Windows APIs are Object Oriented, especially the ones used for scripting, such a WMI. They're not text-based. The notion that what Windows is "really missing" is a bunch of text-oriented Linux shell tools is just nuts. It already has native shells that are better suited to it, such as PowerShell.
Meanwhile I don't particularly recommend PowerShell to Linux people, because its string processing capabilities are not particularly good.
> SSH didn't exist when there were 300 baud connections
Technically true. However, telnet did exist, it was just less secure.
> SSH vs WinRM. Neither were around when the Unix TTY/PTTY/line drivers etc were established.
The point is that I keep hearing Linux admins clamoring for SSH support on Windows, with the argument that Windows is hard to administer because it doesn't have a secure remote shell. Even though it does. They just don't know about it, because they use bash on Windows instead of PowerShell.
The irony is that securely distributing SSH public keys is essentially an unsolved problem (unless I'm missing a recent development), whereas WinRM uses Kerberos to automatically negotiate a temporary key.
Be honest: what fraction of the time do you verify that the public key fingerprint of your first-time SSH sessions really match the fingerprints of the boxes you think you're connecting to?
I'm guessing never...
> But hey, tell us what you think about systemd.
Sure: It's about time Linux caught up to Windows NT 4.0
I can't wait to hear the wails of anguish when the Linux world is dragged kicking and screaming into the Windows 2000 world of Active Directory and its magic powers called Group Policy and ACLs with more than 3 entries.
I had just recently wasted days trying to figure out why some Linux box was basically locking up on a customer network only to discover that pre-systemd the secondary DNS doesn't do what you think it does. It's not a backup DNS server for the primary server at all! If the primary fails, then DNS has failed, period. The primary will be tried 100% of the time with a 30s timeout before the secondary is tried. The secondary will never be treated as a primary, no matter what. Failures aren't cached. Successes aren't cached. Nothing at all is memorised. TTLs may as well not exist.[1] If you have a process that takes multiple DNS requests to succeed, you now have a guaranteed connection timeout.[2] Meanwhile OSX, IOS, Windows, or Linux with systemd will just instantly switch to the secondary DNS and keep trucking along like nothing happened. You know... for redundancy.
I looked this up, researched the issue at length.
There were endless posts on the systemd forums asking for the legacy behaviour back, arguing that the evil systemd people were destroying some sort of precious heritage by introducing heretical notions from other operating systems like automatic failover.
No logical arguments were made. Nothing sane was said. Just an endless torrent of "but that's how it always was".
This is what I think of systemd: I wish there was more of it, and less adherence to 1960s accidental history.
[1] I found it amusing that only RedHat had a working DNS resolver pre-systemd. The others were either insecure due to being abandoned, or did not follow DNS standards such as adhering to TTLs properly. We needed strict TLL support because load-balancers on the network were using short TTLs for some entries.
[2] Anything complex like Kerberos auth to Windows or SAML auth to anything behind a load-balancer. This typically involves 5-20 DNS lookups. At 30 seconds a pop, it's a guaranteed authentication timeout for any reasonable DNS timeout. Even if the DNS timeout is dropped to the minimum of 1 second, this is outrageously slow for a middlebox that does authentication as a part of a high-performance API workflow.
The second article says that 2 of the 3 'delete-like' keys have wonderfully unique failure modes that are essentially unpredictable to the end-user and not fixable from their perspective much of the time.
Meanwhile these keys "Just Work" for all Windows applications, all of the time.
This is my point. The articles you linked are agreeing with it.
Remove-Alias cls
function cls {
echo "$([char]27)c"
}
A similar solution was provided in the GitHub issue that works on older versions of Windows Terminal.ED (Erase Display) is the control sequence to use for clearing the screen in systems with a terminal I/O paradigm. Emit it twice, as ED 2 to clear the whole main screen and as ED 3 to separately clear the scrollback buffer.
Keep in mind that the context here is finding a workaround for a specific terminal emulator.
Very cool link and bit of history, though!
In my opinion, this is shortcoming of this product.
In the future, the following will probably work:
echo "$([char]27)[3J$([char]27)[H$([char]27)[2J"
This matches the output from `tput clear` in WSL.However, as of writing, it's a bit quirky when combined with other PowerShell commands; for example, the following behaves oddly:
ls; echo "$([char]27)[3J$([char]27)[H$([char]27)[2J"; ls
Unfortunately, I don't have a good solution at the moment.In the game I’m building I have a quake style ”dropdown” console and clear() was very easy to implement :)
The basic terminals on linux/macOS are fine. The basic CMD terminal on Windows is terrible and is NOT ok.
If you're using powershell, you can escape newlines with `. If git bash, \. If CMD, I don't know what to tell you -- I don't use it for any serious work. :)
Also, lines pasted from Sublime don't include newlines.
Or you could just, you know, actually use Linux or BSD.
You mind pointing out in the code where it "phones home to Microsoft to let them know what you've been doing with it"?
https://github.com/microsoft/terminal/blob/master/src/termin...
See also the corresponding hpp files.
The files you're linking to--specifically in terminal/parser--serve to tell a local developer running a text-mode application what VT sequences are in common use to help that developer figure out where to apply effort. We can also request that people enable these traces and explicitly view their contents, then choose to send us the data to help us troubleshoot VT parsing issues.
There trace logs aren't even wired up to the "telemetry" stream that everybody's so afraid of: TraceLogging is a local data capture solution first and foremost, and anybody can look at what's being produced using Windows Performance Analyzer. Nothing from this tracing provider leaves the user's computer.
[1] https://news.ycombinator.com/item?id=19322398, https://news.ycombinator.com/item?id=19324538
Some of the recent changes I've seen happening at an increasing scale is having practical support levels:
- fully-managed
- half-managed
- BOYO (Being on your own)
This is then applied to both company-delivered systems as well as BYOD systems. Combined with standard interrogation tools like osquery you can get a much better picture of what is happening and what level of compliance you can measure.
Instead of them implicitly trusting or hoping a device is okay you actually get to measure it. This enables a BOYO-BYOD BSD fanboy to present themselves as being in-spec and compliant while being in their own comfortable environment for maximum productivity. At the same time, someone who has a hard time figuring out how to turn a laptop on just goes for fully-managed, still gets measured periodically and on-access and gets a generic experience allowing normal-people productivity.