Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bulletinmybeard/8a3ad86c0a31fb7b3e55d659b7a6f446 to your computer and use it in GitHub Desktop.
Save bulletinmybeard/8a3ad86c0a31fb7b3e55d659b7a6f446 to your computer and use it in GitHub Desktop.
Using `PROMPT_EOL_MARK` to remove extra trailing mark in Terminal Output (macOS+Linux)

If you encounter an extra percent mark at the end of the command output (e.g., %), it's likely caused by the PROMPT_EOL_MARK. To fix this issue, you can either export the following environment variables for the current shell session or add them to your bash or zsh configuration file to make the changes permanent.

export PROMPT_CR
export PROMPT_SP
export PROMPT_EOL_MARK=''

Before

# Before
~ kubectl get deployment service -o jsonpath='{.status.replicas}'
2%

# Set to empty string
export PROMPT_EOL_MARK=''

# After
~ kubectl get deployment service -o jsonpath='{.status.replicas}'
2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment