Creating a Decent Portable Terminal Windows
Preamble
Directions for creating a portable build of Alacritty with a portable set of busybox tools and windows CLI applications.
The goal is to have a good terminal emulator that can be ran on any system. I prefer avoiding WSL and Cygwin.
Directory Structure
Alacritty is the terminal emulator. In the same folder is a RUNME.bat that configures the environment and sources the alacritty.toml file.
All files placed in the bin
folder will be added to the path. I have a separate
shim
folder contains wrapper scripts to run busybox functions and applications
in the subfolders within bin
Alacritty-v0.15.1-portable.exe
alacritty.toml
RUNME.bat
shims
awk.cmd
vim.cmd
[...]
bin
7zr.exe
aria2c.exe
busybox.exe
pageant.exe
plink.exe
pscp.exe
psftp.exe
python
curl
vim91
[...]
Installing
- Download Alacritty from https://github.com/alacritty/alacritty/releases
- Create a bin and shims folder in the same folder as the application
- Create your
RUNME.bat
andalacritty.toml
files
RUNME.bat:
@echo off
cd /d "%~dp0"
set PATH=%~dp0bin;%~dp0shims;%PATH%
start /b "" Alacritty-v0.15.1-portable.exe --config-file "%~dp0alacritty.toml"
alacritty.toml:
[window]
opacity = 0.9
padding.x = 10
padding.y = 10
decorations = "Full"
decorations_theme_variant = "Light" # "Dark"
[terminal.shell]
program = "powershell.exe"
args = ["-NoExit", "-Command", "Set-Location $env:USERPROFILE"]
[font]
normal.family = "Aporetic Sans Mono"
bold.family = "Aporetic Sans Mono Bold"
italic.family = "Aporetic Sans Mono Italic"
bold_italic.family = "Aporetic Sans Mono Bold Italic"
size = 15.0
[keyboard]
bindings = [
{ key = "V", mods = "Control|Shift", action = "Paste" },
{ key = "C", mods = "Control|Shift", action = "Copy" }
]
Adding applications to PATH
Place standalone binaries in the bin folder. Subfolders aren't decended.
Files placed in the shims folder are added to the PATH too. Create a new wrapper script for each custom application you want to run
I used a script to create most the wrapper scripts for busybox. Separately I manually created wrappers to run applications such as Python and Vim portable.
arch.cmd:
@echo off
"%~dp0\..\bin\busybox.exe" arch %*
Using Alacritty
Run the RUNME.bat. Your config file will be sourced and all files in the bin
and
shims
folders will be in your $PATH