Change Color of Text Being Currently Used (Terminal - OSX) -


for reference purposes: using macbook pro retina (2014) , software date of time posting question. (using osx 10.10.2 yosemite)


i have been struggling past few days attempted customized terminal window. going fine... until decided wanted change color text typing (text input) executed.

i have no problems getting .bash_profile , adjusting anything. cannot seem grasp color concept enough such 1 thing me. .bash_profile looks this:

export ps1="\n\n\njboned$ " export path="/usr/local/mysql/bin:$path"  export clicolor=1 export lscolors=exfxcxdxbxegedabagacad 

any assistance appreciated. as sidenote: understand 8-bit snippets used represent individual colors, seems cannot figure out how use them address text input only.

to asking, these steps needed:

  • at end of prompt, turn on text color want show
  • when press return (to complete editing) turn text-color off.

bash not reset attributes while edit, color "should" work — while editing. edit, bash use escape sequences clear current line (which may fill whatever background color have selected).

the real problem how reset colors when press enter. not appear have straightforward solution: not see way rebind enter key add features—no distinction made between levels of interpretation, , may not find possible enhance enter key. key binding feature in bash talks readline library; leftovers sent bash. in binding may able these things:

  • send name of macro bash, or full echo command resets colors (since readline has no echo of own, seems)
  • the enter key (i.e., ^m), and
  • to readline directly, accept-line function

alternatively, could bind key, control/l bash accept-line function resetting color. here couple of links find useful investigate how this:


Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -