19 ms·
Windows Terminal Source Code
- rolph 4y agothis caught my eye: >>Installing and running Windows Terminal Note: Windows Terminal requires Windows 10 2004 (build 19041) or later Microsoft Store [Recommended] Install the Windows Terminal from the Microsoft Store. This allows you to always be on the latest version when we release new builds with automatic upgrades. This is our preferred method. Other install methods Via GitHub For users who are unable to install Windows Terminal from the Microsoft Store, released builds can be manually downloaded from this repository's Releases page. Download the Microsoft.WindowsTerminal_<versionNumber>.msixbundle file from the Assets section. To install the app, you can simply double-click on the .msixbundle file, and the app installer should automatically run. If that fails for any reason, you can try the following command at a PowerShell prompt:<<
- pooper 4y agoI am glad to see scoop called out in the list of installation methods. I use scoop and like the idea behind scoop. Applications should install in my user_profile when possible and should only require sudo when it isn't possible. All new application in $current_year should install as $current_user_scope by default. I hate how applications (looking at you, Google Chrome) try to install a scheduled task to keep itself updated. All of this should be up to the package manager. If I want to update the client application, I will do so myself.
- legulere 4y agoYou can also just install it with winget
- easton 4y agoAnd the winget version updates automatically with the Microsoft Store (not that that matters much if you are into using scoop/choco, since you know to just scoop upgrade)
- croddin 4y agoMy preferred method would be choco install microsoft-windows-terminal
- Bostonian 4y agoJust wondering -- why would Microsoft release the source code for this component of Windows?
- uuyi 4y agoI think they are load testing their github acquisition...
- tiernano 4y agothe code has been open since the beginning of the project, IIRC... back when it was announced first, to get it to build, you needed to build it locally...
- runevault 4y agoNot sure I'd really call this a component of the OS. It is a new app that works with various shells (including cmd, powershell, and WSL) to create a better experience using them including tabbed view so you can have multiple terminals from a single window.
- easton 4y agoThe core console emulator for Windows is a part of this too: https://github.com/microsoft/terminal/tree/main/src/host https://github.com/microsoft/terminal/tree/main/src/host
- kaelinl 4y agoThere are multiple projects in this repo. Windows Terminal, which the other commenters focus on, is a relatively new standalone app and not (yet?) bundled with the OS. They opted to open source it from the start, more or less. The other part is conhost, which is the classical terminal that has existed in Windows for decades. Some of the layout and rendering logic was pulled out of conhost to be shared with Terminal, and the two projects are maintained by the same team, so they open-sourced both. As I understand it, they then ship conhost and its shared components in Windows releases.
- 4y ago
- Lammy 4y agoHere are all the ways it spies on you: https://github.com/microsoft/terminal/search?q=Telemetry%3A%3AInstance https://github.com/microsoft/terminal/search?q=Telemetry%3A%... https://github.com/microsoft/terminal/blob/main/src/host/telemetry.hpp https://github.com/microsoft/terminal/blob/main/src/host/tel...
- whywhywhywhy 4y agook, what do those do?
- foolfoolz 4y agotell microsoft when you’re using features. presumably because they have a culture of metrics and every feature is required to have data on its usage patterns
- nojito 4y agoIt's just used to drive improvement efforts rather than focusing on features + bugs no one cares about/uses.
- rolph 4y agoi read the code , they take usage data points build a logfile and wait for a request to retrive.
- Lammy 4y agoThere are some pretty detailed comments on many of them if you click through to their call sites, and more can be inferred from the file names of the callers. Let's take a look at `windowio.cpp` for example. This most-generic event fires every time you type any input character on the keyboard: https://github.com/microsoft/terminal/blob/57c3953aca49f68acc480ca27533fdc7aad78b43/src/interactivity/win32/windowio.cpp#L165-L173 https://github.com/microsoft/terminal/blob/57c3953aca49f68ac... It also has more-specific events for several different ways of selecting, copying, and pasting text: https://github.com/microsoft/terminal/blob/57c3953aca49f68acc480ca27533fdc7aad78b43/src/interactivity/win32/windowio.cpp#L230-L329 https://github.com/microsoft/terminal/blob/57c3953aca49f68ac... In `find.cpp` we can see it log every time you find the next result in the "Find" dialog, as well as when the dialog is closed: https://github.com/microsoft/terminal/blob/57c3953aca49f68acc480ca27533fdc7aad78b43/src/interactivity/win32/find.cpp#L64-L82 https://github.com/microsoft/terminal/blob/57c3953aca49f68ac... In `windowproc.cpp` we can see it log every time you resize a console window, close a console window, bring up the context (right-click) menu, drag-and-drop on to a console window: - https://github.com/microsoft/terminal/blob/57c3953aca49f68acc480ca27533fdc7aad78b43/src/interactivity/win32/windowproc.cpp#L164-L174 https://github.com/microsoft/terminal/blob/57c3953aca49f68ac... - https://github.com/microsoft/terminal/blob/57c3953aca49f68acc480ca27533fdc7aad78b43/src/interactivity/win32/windowproc.cpp#L323-L332 https://github.com/microsoft/terminal/blob/57c3953aca49f68ac... - https://github.com/microsoft/terminal/blob/57c3953aca49f68acc480ca27533fdc7aad78b43/src/interactivity/win32/windowproc.cpp#L474 https://github.com/microsoft/terminal/blob/57c3953aca49f68ac... - https://github.com/microsoft/terminal/blob/57c3953aca49f68acc480ca27533fdc7aad78b43/src/interactivity/win32/windowproc.cpp#L868-L872 https://github.com/microsoft/terminal/blob/57c3953aca49f68ac... This even extends outside the "Terminal" application wrapper itself, with a generic "LogApiCall" used to track e.g. any time any other process spawns a console window: - https://github.com/microsoft/terminal/blob/57c3953aca49f68acc480ca27533fdc7aad78b43/src/host/srvinit.cpp#L797-L798 https://github.com/microsoft/terminal/blob/57c3953aca49f68ac... - https://github.com/microsoft/terminal/blob/57c3953aca49f68acc480ca27533fdc7aad78b43/src/host/telemetry.hpp#L56-L124 https://github.com/microsoft/terminal/blob/57c3953aca49f68ac... Click around a few of the search results and see what else you can find!
- wayne 4y agoHad a really fun trailer/video when it launched: https://www.youtube.com/watch?v=8gw0rXPMMPE https://www.youtube.com/watch?v=8gw0rXPMMPE
- tambourine_man 4y agoApple should follow MS's example and open source its Terminal.app It's a decent terminal emulator, but could use several enhancements and the community could help. For some reason I haven't changed to iTerm yet, even though it's been objectively better in every way for years. Even the minor gripe I had with font rendering is fixed. There's something about using default apps as much as possible that appeals to me. But Terminal.app is lagging compared to the competition.
- rbanffy 4y ago> It's a decent terminal emulator, but could use several enhancements and the community could help. It's the only modern terminal that passes the VT torture test. It supports double width and double height characters (great for terminal error messages). It doesn't support overline (which is awesome for status lines at the bottom of the screen) and requires font support for line drawing and block graphics (Unicode 13 introduced 2x3 blocks and the next one will introduce 2x4s). > There's something about using default apps as much as possible that appeals to me For me it's one less thing to distract my distraction-prone brain.
- tambourine_man 4y agoBetter keyboard only text selection, vertical/horizontal splits (I know about tmux, I still prefer scrolling and searching on true app), true color support, image visualizing would be nice.
- Komodai 4y agoVT torture test?
- DHowett 4y agoI think rbanffy is referring to vttest[1], but I'm not certain. [1]: https://www.invisible-island.net/vttest/ https://www.invisible-island.net/vttest/ EDIT to add: vttest is maintained by the current maintainer of xterm. It's the "torturiest" VT test I know of.
- Genbox 4y agoNote: This is not news of any kind. Windows Terminal has been open source since its first release 3 years ago.
- capableweb 4y agoNote: Hacker News is not exclusively for "news" (nor exclusively for "hackers" for that matter).
- Snowworm 4y agoYeah. Tbh, I haven't seen any news that would be significant for hackers in particular, the posts are mainly for software Devs.
- str3wer 4y agofor sure my code is a pile of hacks
- smaudet 4y agoI think we ARE hackers. If you have ever been in hacker culture, you know they don't mean cracker, or even cyber security culture. We definitely have cracking articles here from time to time (legal ones with responsible discosure or hacks of defunct games or software), even cyber writeups. Hacking just means, hacking together. Its your weekend project to wire up your flower beds to your computer so you can monitor on your phone. The majority of hackers are not people in cyber gangs perpetrating crimes, they are more like tinkerers. There are lots of software people who absolutely do not hack in their free time, and lots of hackers who are nor software engineers. Hackers tend to build some great stuff, though, so you do see it in industry stuff a lot.
- dundarious 4y agoWorth watching Casey Muratori's series of videos on terminals, and how to implement them, where he often makes specific comparison to Windows Terminal. He has some specific criticisms that are easy to disagree with, but the vast majority are well warranted. His broader series of videos on the topic are even worthwhile from a purely "software engineering education" standpoint. https://youtu.be/hxM8QmyZXtg https://youtu.be/hxM8QmyZXtg I feel a bit bad about posting comments about it relatively frequently on HN, but it's just so very very good, and snark aside, his perspective is extremely valuable.
- markus_zhang 4y agoI hope someone can take his demo and implement the idea for Windows Terminal. This would prove that such performance boost is indeed doable for a real world production level terminal.
- naikrovek 4y agoThe Terminal team is very aware of this code, and are not able to use it due to how Casey licensed it. They aren't even allowed to look at it. Casey deliberately licensed it as GPL so that Microsoft could not use it, actually. That's his choice, of course. The Terminal team have a path forward to implement strong performance improvements based on techniques like those Casey described, and are working on those improvements now, I'm told. Microsoft haters will continue to say all kinds of stuff no matter what Microsoft does, so Microsoft isn't doing this to appease anyone; it's just performance work that they didn't understand was as easily reached as it is, and they built the Terminal in wrong ways the first time around. Anyway, it's being fixed. I've never worked at Microsoft but I've worked with a lot of MS employees throughout my career and I wish I could convey just how much the goals of the individual employees line up with people like us. The developers at Microsoft are people like us. Extremely and intentionally caustic feedback on Microsoft stuff does nothing but give those employees good reason to stop working on the projects they love, but which also get the most attention, like Terminal. This necessarily produces a worse outcome for the project. I wish I could make the extremely vocal and vitriolic people understand that their vitriol is counterproductive in the extreme, and makes everything worse.
- nyolfen 4y agowinterm looks very nice but it often screws up character alignment if you resize the window. it happens so frequently that i gave it up, because at least once a day i could no longer tell what i was typing or trying to copy. i'm a happy customer with alacritty windows builds, but i wish it had tabs.
- dpool 4y agoYou're probably already aware of this, but just in case you're not (or someone else reads this that's curious), running tmux (src: https://github.com/tmux/tmux/wiki https://github.com/tmux/tmux/wiki) inside alacritty will give you tab functionality along with the ability to horizontally/vertically split and a host of other fun features.
- nyolfen 4y agoyes, i'm still a tab clicker though :)
- justusthane 4y agotmux has mouse support!
- CoolCold 4y agoWezterm then
- galkk 4y agoIs it tmux -CC style of iterm2 or you meant native tmux features?
- naikrovek 4y agoWezterm is nice and it has tabs.
- jajcjuvuvgy 4y ago
- mattl 4y agoWhen did people stop calling them terminal emulators?
- pjmlp 4y agoThere are only terminal emulators on UNIX clones. When Windows Terminal is running cmd or Powershell underneath, there is zero emulation going on.
- kevin_thibedeau 4y agoThey emulate ANSI control sequences originally intended for dumb terminals and the teletype bell.
- pjmlp 4y agoWhich were never a thing in MS-DOS, Windows, OS/2, Amiga, Atari,...
- LocalH 4y agoThat's not true. MS-DOS and Amiga supported ANSI escape sequences, I remember that very clearly. Through MS-DOS, Windows and OS/2 would have had some form of support available. No clue about the ST
- pjmlp 4y agoYeah, but not as dumb terminals, hence no emulation.
- mattl 4y agoThere were products like Concurrent DOS, Windows Terminal Server…
- pjmlp 4y agoNone of them had anything to do with UNIX terminals. Ironically you even list one that is a RDP server, completly unrelated to CLI. Random Google search without diving into details?
- briHass 4y agoThough I've been enjoying WT, there are some limitations that have bit me: 1) As a 'Store' app, it can be a pain to install in locked-down corpo networks that block Windows Store. Winget can be a workaround, or you can extract the exe from packages, but an installer would be nice. 2) Since it's a UWP app, there's no way to launch it as another user-identity (i.e. runas)
- deleted 4y ago[deleted]
- zamadatix 4y agoThe GitHub releases section has the msix installer package too. Terminal itself can't be runas but e.g. cmd.exe or pwsh.exe inside of it can be.
- briHass 4y agoHow do you get that to work? I've tried changing the settings to open new terminal windows using a different identity (runas), but they are then separate from the terminal app. I basically would just like to be able to dock that new window in the existing terminal tabs, as otherwise, I might as well just launch a PoSH prompt.
- zamadatix 4y agoYou can launch into any security context but merging multiple contexts under a single window is not supported. It has to do with Windows lacking session elevation for pipes but supporting it for window handles https://github.com/microsoft/terminal/blob/main/doc/Niksa.md#elevation https://github.com/microsoft/terminal/blob/main/doc/Niksa.md... If you want to get real hacky in the meantime you can run the ssh server service and have a short alias to ssh to localhost as a user but now you have that extra abstraction between to deal with.
- Schopenhauer01 4y agoChoco is IMO the best way to install apps on windows right now. `choco install microsoft-windows-terminal`
- kramerger 4y agoNote that this is not the source code for the command shell utility (command.com, cmd.exe, etc). This is a new (-ish) project for creating a modern terminal It works really nice with WSL, for example I have configured each OS to have its default font and wallpaper :)
- PufPufPuf 4y agoIt actually is both! They put both codebases, Windows Terminal and cmd.exe, in this repo. See the readme for more info.
- xrayarx 4y agoIt shall be noted, that it does not work on Windows Server up to and including 2019. I would also like to add, that I am puzzled, that Microsoft has not been able to deliver a proper shell, that is comparable to …sh and delivers remote access like ssh. Yes, Powershell, but not by a long shot. And for some things you still need cmd!