windows-for-linux-and-macos-devs

Windows for Linux and MacOS devs

GitHub Page

A hitchhiker’s guide for Linux or MacOS devs who need to use windows.

Going from MacOS or Linux to windows, why would you even do that? You might ask. Maybe you have to share a laptop with family members who have Windows installed? Would you really want to spend your energy convincing them that Linux is a much better option? Or convince them to buy a expensive Mac? Making the sweet promise that all their IT problems will be gone later on; they just needed a bit of help. A different thing would be if they have an old laptop that doesn’t get any mac updates or they have windows but this old machine became slower and slower because newer windows require a more powerful machine, in that case, yes install a Linux and tell them you just saved their laptop, no need to buy a new one.

Would you turn down an interesting job offer just because they use Windows? They do some cool stuff, but their clients are using Windows. What would you do? Convince the client mega-corporation to switch to Linux? Dump the offer and continue at your non-fulfilling job because they gave you a Mac?

Unless you are in a privileged position where you can choose the OS you develop on, chances are that you will have to touch other Operating Systems in the future too.

We have several options, never touch windows, one could throw away tools that don’t work on windows and learn different tools for each OS or you could throw away tools that are not cross-platform and learn tools that you can use on every OS.

If you use apps that work on multiple operating systems you won’t need to keep forgetting and relearning different tools that solve the same problem on each OS. In a way the OS becomes something like your graphics cards driver, you don’t care much about it as long as it does it’s job, even though not completely the OS starts getting out of the way.

Finding good resources is not easy, I did not come across many resources covering this topic, but the ones I found where mainly saying, use WSL and run the tools you are used to over there, e.g. tmux. I think WSL is amazing, but in my experience, it’s works great until you need to do native things and then you are again left naked in the middle of the blue ocean. At the end of the day in my opinion not very good advice.

Luckily Chris Patti & Ned Batchelder have some good advice on their pages.

This are notes I wished I found before I went through discovering what worked and what did not work so well on windows. E.g. using emacs on windows was a pain, git was extremely slow and I had to make a prayer every time I updated packages, things getting broken became the norm and on top of that I faced gpg errors during updates, maybe things changed now but moved on to something else.

A package manager

There are other package managers too but winget is from microsoft itself and you can get a lot of stuff from one command already.

winget install wez.wezterm Nushell.Nushell Dystroy.broot sysinternals BurntSushi.ripgrep.MSVC sharkdp.fd junegunn.fzf JesseDuffield.lazygit Git.Git GitHub.GitHubDesktop GitHub.GitLFS GitHub.cli Flameshot.Flameshot Python.Python.3.12 GoLang.Go Rustlang.Rustup OBSProject.OBSStudio Neovim.Neovim GIMP.GIMP vscode VideoLAN.VLC SumatraPDF.SumatraPDF

Looking for a package, use winget search or look winget-pkgs

Are you an European coder?

If you are non english native speaker you can use The Layout for Europeans, Coders and Translators eurkey. It has all the advantages of the US standard layout for programming while you still have access to most western-european characters, e.g. çßàáäßæå can be written with ease using AltGr. For other languages like Thai, Chineese, russian … I don’t have any suggestions.

example

Throw away tools that are not cross-platform and learn tools that you can use on every OS

Wezterm as of today to my knowledge the only terminal with tmux like capabilities that works nicely across all major three OS. Check Default Key Assignments, ctrl + shift + alt + " for vertical splits ctrl + shift + alt + % for horizontal splits and ctrl + shift + z to zoom should be enough to get you started, eventually you will probably want to define your own shortcuts, create new sessions with ease (see here), all can be done with Lua within .wezterm.lua in your home folder. I personally like alt + h j k l for moving between splits and alt + - and alt + \ for vertical and horizontal splits (see here).

Nushell is a cross platform shell with clearer error messages with cues from bash and powershell, it also uses coreutils internally, so many unix utilities you know they are already available without having to install something like cygwin. Coming form bash is a good place to start. If you like fzf search for change_dir_with_fzf in here has a low effort snippet to change directories effectively, I personally prefer broot for that but just use whatever floats your boat.

Flameshot is an easy to use tool to share screenshots explaining what’s going on, good for making bug reports and explaining things.

Windows specific stuff

Some stuff will be very windows specific but that’s ok, at the end of the day you are here using windows right?

Disable annoying default hotkeys

If you accidentally press Win + SPACE , ALT + SHIFT or CTRL + SHIFT keyboard layouts and languages will change behind the scenes. This was never what I wanted. Disable them and save you headaches.

Open example

And remove all key sequences example

Jumping between windows

alt+tab has nice animations but when you do a lot of it, it can feel annoyingly slow. Instead you can use alt+esc which will switch no next windows without asking, that feels better, if you combine it with a remap of Caps Lock to esc, isn’t that bad after all.

Pin the apps you use the most to your taskbar and use the windows key plus a number (Win + 1, Win + 2, …) to jump between them instead of alt tabbing between apps you frequently use

In the example below it would trigger the following apps Win + 1 Wezterm, Win + 2 Firefox Win + 3 Gimp, Win + 4 DebugView, Win + 5 System Informer.

example

In Gnome Desktop in Linux if you pin and keep apps in the same order in the tab bar you can use the same shortcuts across different OS too.

Good to install

If you install one thing only, install system-informer or process explorer. A better task manager, impressive, play around with it to see what it can do for you. Many things Sysinternals do, you can do it directly from system-informer.

Troubleshooting an issue?

Even if they are not the same sysinternals seems to be the closest thing for Instruments or dtrace on mac or strace, lsof and friends on Linux.

Not windows but for MacOS and Linux brendangregg is worth to read.

On linux: http://upstate.net/jen/linux_performance_tuning.jpg

Linux MacOS Windows
strace dtrace procmon
TODO TODO TODO

For more low level stuff like dtrace or ebpf look at ebpf-for-windows.

Below a non exhaustive list of things you can do with it:

Windbg

rust-windbg

Analyze heap memory allocations

UMDH