Coder Social home page Coder Social logo

Background color for prompt only? about fzf HOT 4 CLOSED

tmpm697 avatar tmpm697 commented on July 17, 2024
Background color for prompt only?

from fzf.

Comments (4)

LangLangBart avatar LangLangBart commented on July 17, 2024 2

but then how can i remove that pink < in prompt --> it seems padded to STR in --prompt=STR

--info=hidden or --info=inline: might suffice

man fzf | less --pattern "--info=STYLE"

another issue is that how can i change the color of text LOCATION from black to white?

🧐 I don't know.


If the color options provided by fzf for the prompt are inadequate, you could try workarounds:

ANSI-C Quoting $'123

fzf --prompt $'\e[1;37;45m LOCATION \e[0m '

ZSH Command

The builtin print command coupled with the -P flag allows to use PROMPT SEQUENCES, see the zshmisc man page for more.

man zshmisc | less --pattern "PROMPT SEQUENCES"
fzf --prompt "$(print -P -- "%K{164}%B LOCATION %~ %b%k ")"
term description
%K{numeric|string} Start using a background color
%B Start bold
%~ Current working directory
%b End bold
%k End using background color

Footnotes

  1. Bash Reference Manual - ANSI-C Quoting

  2. bash quotes (wizardzines.com)

  3. bash:tip_colors_and_formatting - FLOZz' MISC

from fzf.

tmpm697 avatar tmpm697 commented on July 17, 2024 1

u always amazed me with such a detailed thoughtful reply :)

from fzf.

LangLangBart avatar LangLangBart commented on July 17, 2024

You could try using the reverse ANSI attribute.

man fzf | less --pattern "ANSI ATTRIBUTES"

fzf --prompt " LOCATION " --color "prompt:magenta:reverse"

The problem is that the trailing space is not colored in magenta.


Instead of a normal space, try it with a non-breaking space.

On macOS, the key combination seems to be Option + Space 1.

Character Unicode
Space U+0020
Non-Breaking Space U+00A0

Footnotes

  1. Non-breaking space: how to insert one? - Apple Community

from fzf.

tmpm697 avatar tmpm697 commented on July 17, 2024

Screenshot 2024-05-07 at 4 39 01 PM
but then how can i remove that pink < in prompt --> it seems padded to STR in --prompt=STR

another issue is that how can i change the color of text LOCATION from black to white?

ty

from fzf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.