Home

Awesome

nerdps1

Transportable Nerd prompt for bash/ksh/zsh (mksh/ash)

New: you can now use thefly to teleport all you shell env/plugins

Font for prompt

For better experience, install a Nerd font on your system/console (Windows console / Windows terminal / putty / git-bash / CmdEr / iTerm2 / Terminator / MobaXterm / VScode terminal / Pycharm terminal...):
Consolas NF
Nerd Fonts

on Unix, copy to ~/.fonts and run fc-cache -fv then relaunch your terminal and set the font

Installation

<img width="900" alt="image" src="https://github.com/joknarf/nerdps1/assets/10117818/ebc3f680-69b1-45d2-b1ce-b09b09b545f2">

Following information displayed:

choose your style

set ps1_style variable to available styles in your .nerdrc
You can test using ps1_style function:

image

persistent prompt across sudo

Using functions psudo you can login to other users keeping your nerdps1 prompt, and even add your environment file to source after user profile is loaded.

$ psudo user [myenvfile]

image

psudo can be used multiple times to forward the prompt/environment to users (psudo user1 followed by psudo user2...)

persistent prompt across ssh connection

Using functions pssh and psshu you can connect to remote servers with your nerdps1 prompt, and even add your local environment file to source after user profile.

$ pssh [user@]remote [myenvfile] [ssh options]
$ psshu [user@]remote [myenvfile] [ssh options]

pssh\psshu can be used multiple times to forward prompt/environment (can be mixed with psudo too)

image

$ ssh -t <remote> '. <(curl -s https://raw.githubusercontent.com/joknarf/nerdps1/main/nerdps1) login'

or in .ssh/config:

    RequestTTY force
    RemoteCommand . <(curl -s https://raw.githubusercontent.com/joknarf/nerdps1/main/nerdps1) login

using .nerdrc as your custom env file

Instead of passing custom env file, you can create a ~/.nerdrc env file that will be automatically sourced after user profile and forwarded by psudo/pssh/psshu.
You can put all ps1_ variables to override nerdps1 defaults, and all functions/path/env settings you want to have everywhere !

/tmp full proof

nerdps1 will use /var/tmp if not enough space in /tmp. (ssh connections can occur even if /tmp full on remote)

Font rendering

If your terminal does not manage correctly nerd font symbols, you may switch to more commonly supported powerline font symbols, or even disable the segment separator symbols.
You can use : ps1_display function/var to switch prompt display symbol characters:

$ ps1_display -h
usage: ps1_display <option>
    <option>: nerdicons, nerd, powerline, nofont, ascii

Customizing prompt

You can add informations on the prompt using ps1_info variable:

You can add custom colorized segment defining ps1_addon() function:

Changing prompt powerline, ps1_powerline variable represents the prompt:

color theme example

used terminal colors in example:

        {
            "name": "NerdPS1",
            "background": "#000000",
            "foreground": "#D3D7CF",
            "black": "#000000",
            "blue": "#2760AA",
            "cyan": "#06989A",
            "green": "#088A5B",
            "purple": "#4c3d80",
            "red": "#BA1611",
            "white": "#D3D7CF",
            "yellow": "#CF8700",
            "brightBlack": "#243C4F",
            "brightBlue": "#729FCF",
            "brightCyan": "#34E2E2",
            "brightGreen": "#59c566",
            "brightPurple": "#AD7FA8",
            "brightRed": "#EF2929",
            "brightWhite": "#EEEEEC",
            "brightYellow": "#FCE94F"
        }