Files
fish-config/functions/bkg.fish
T
rootiest 4c1e7a7eb9 feat: initial fish shell configuration
- Core config layered on CachyOS base with Catppuccin Mocha theming
- Fisher plugins: fzf.fish, catppuccin, autopair, replay, puffer-fish, magic-enter, spark
- Smart CLI wrappers with fallbacks (bat, lsd, btop, dust, prettyping)
- Custom functions: git, docker, network, kitty, AI session management
- Extensive abbreviation system for keyboard-driven workflows
- Secrets/local sourcing pattern for private and machine-specific config
- README with full documentation and personalization guide
- AGPLv3+ license with copyright headers on all source files
2026-04-26 01:37:38 -04:00

27 lines
811 B
Fish

# Copyright (C) 2026 Rootiest
# SPDX-License-Identifier: AGPL-3.0-or-later
# Function to run a command in the background, detached from the terminal.
# This prevents the command from being terminated when the terminal is closed.
# All output (stdout and stderr) is discarded.
#
# Usage:
# bkg <command> [arguments...]
#
# Example:
# bkg firefox
# bkg code .
#
function bkg
# Check if a command was provided as an argument.
if test -z "$argv[1]"
echo "Usage: bkg <command> [arguments...]"
return 1
end
# Run the command using nohup to make it immune to hangups (like closing the terminal).
# Redirect both stdout and stderr to /dev/null to discard all output.
# The final ampersand (&) sends the entire process to the background.
nohup $argv &>/dev/null &
end