A more userfriendly and interactive version of fg.
Are you like me and frequently use fg to switch between applications? Does the fg %[index of the job] workflow feel a bit less than optimal? Then better-fg is for you!
- Interactive TUI for selecting from multiple background jobs
- Fuzzy searching for jobs
- Support for
fg %<number>andfg <number> - Falls back to normal
fgbehavior when there is only one background job
brew install super-smooth/tap/better-fgcurl -sSL https://raw.githubusercontent.com/super-smooth/better-fg/main/install.sh | bash# Install directly from the repository
nix profile install github:super-smooth/better-fg
# Or run without installing
nix run github:super-smooth/better-fgDownload the latest binary from the releases page and place it in your PATH.
To use better-fg, you need to initialize it in your shell. This is required because the tool needs to interact with your shell's job control.
-
Make sure the
better-fgbinary is in your system'sPATH. -
Add the following line to your shell's configuration file (e.g.,
~/.zshrc,~/.bashrc):eval "$(better-fg init)"
-
Restart your shell or source your configuration file (e.g.,
source ~/.zshrc).
Now you can use the bfg command to interactively select background jobs, or continue using fg for the traditional behavior.
- Go 1.21+
- Nix (optional, for development environment)
# Clone repository
git clone <repository-url>
cd better-fg
# Setup development environment
direnv allow # if using Nix
# or
nix develop # if using Nix without direnv
# or
go mod download # if using Go directly
# Setup git hooks for commit message validation
./scripts/setup-git-hooks.sh
# Run tests
go test ./...
# Build using Go
go build -o better-fg ./cmd/better-fg
# Or build using Nix
nix build .#default