colored prompt and commands executed
See original GitHub issueit would be nice, to have colors for the pgcli prompt available like the psql
command has.
for example, this is my prompt in psqlrc which looks more appealing.
\set PROMPT1 '%[%33[%0;33m%] 🐘 %`date +"%H:%M:%S"` %[%33[%0;34m%]» %[%33[%0;31m%]%n%[%33[%0;33m%]@%[%33[%0;36m%]%M:%> %[%33[%0;35m%]%x%# %[%33[%0;0m%]'
\set PROMPT2 '%[%33[%0;33m%] 🐘 %R » %[%33[%0;0m%]'
the %
allows you to pass vt color codes thrugh with the %[
%]
syntax and even better, with
%`date`
you can execute commands, which results in a nice colored prompt with the current time.
can we have this in pgcli too?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Color cmd command - GeeksforGeeks
Type the command – color /? in the Command Prompt. It sets the default console foreground and background colors.
Read more >BASH Shell Change The Color of Shell Prompt on Linux or UNIX
This page explains how to set up or change the color of bash shell prompt by editing $PS1 variable on a Linux, *BSD,...
Read more >Bash/Prompt customization - ArchWiki
Prompts. Bash has four prompt strings that can be customized: PS0 is displayed after each command, before any output.
Read more >Coloured commands in terminal prompt - macos - Super User
Coloured commands in terminal prompt ... This way I get the /working/directory $ in bold red, but I also want to get the...
Read more >Dynamic Bash Command Prompt Highlighting - Bianchini Love
This post goes over how to add dynamic command prompt coloring to your bash shell and discusses a few ways to customize your...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You can install directly from the master branch using:
Here’s an example of colored prompt in the config:
\x1b[
followed by the color code.35m
for purple,32m
for green and36m
for cyan.This is what the prompt looks like:
It’s not working for me in that version, the characters from the code above just appear as they are. Could you give an example of a couple of different colors in your prompt and I can try that in mine to see if it works?