Giter Site home page Giter Site logo

context-color's People

Contributors

azrdev avatar ramnes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

context-color's Issues

shellcheck issues

https://www.shellcheck.net/ suggests some issues:


In context-color line 19:
readonly PROGNAME=$(basename $0)
                             ^-- SC2086: Double quote to prevent globbing and word splitting.


In context-color line 49:
    expr 1 + "$(__context_color_hash)" % \( "$(__context_color_count)" - 1 \)
    ^-- SC2003: expr is antiquated. Consider rewriting this using $((..)), ${} or [[ ]].


In context-color line 53:
    local capname="setaf"
    ^-- SC2039: In POSIX sh, 'local' is undefined.


In context-color line 60:
    local sequence="$(tput $capname $(__context_color_number))"
    ^-- SC2039: In POSIX sh, 'local' is undefined.
          ^-- SC2155: Declare and assign separately to avoid masking return values.
                                    ^-- SC2046: Quote this to prevent word splitting.


In context-color line 77:
        local delim=""
        ^-- SC2039: In POSIX sh, 'local' is undefined.
              ^-- SC2034: delim appears unused. Verify it or export it.


In context-color line 97:
    eval set -- $args
                ^-- SC2086: Double quote to prevent globbing and word splitting.


In context-color line 118:
    echo -n "$(__context_color_sequence)"
         ^-- SC2039: In POSIX sh, echo flags are undefined.


Overlaping long command line

Hello,
I've experienced an issue that I didn't notice first:
When using the classic $(context-color) command for customizing my prompt like this:

PS1='[\d \A] \[\e[31m\]\u\[\e[0m\]@\[\e[0m\]$(context-color -c hostname)\h\[\e[0m\]:\w\\$ '

The prompt always used 1 line for big command lines; E.g long lines are wrapped around themselves, meaning that the new line overlaps the previous one. So the terminal wasn't usable anymore.

I figured this was a classic issue with PS1 customization and it is because the colour code wasn't wrapped inside brackets as in \[\e[31m\] where the colour code \e[31m is wrapped inside \[ \]. So to sort this problem out I just changed $(context-color -c hostname) to \[$(context-color -c hostname)\] and it worked fine.

I don't know if this is normal and expected behavior?

RED for Root

Great script, it would be good for a --safe option or similar to make Root and all its text output RED.
This maybe enforces red for danger when using root.

Simple question

This looks great!

A simple question: Do I need to add the

export PS1="$(context-color -p)$PS1\[\e[0m\]"

line to the ~/.bashrc of every user I might be su'ing as?

Thanks.

Doesn't change prompt colors

$ context-color -c 'echo hi'

$ context-color -c "date" -p
\[\]

Running export PS1="$(context-color -p)$PS1\[\e[0m\]" does not seem to change my current prompt colors. From the README, I thought it would change them immediately. I'm not really sure why it didn't.

GNU bash, version 4.4.12(1)-release (x86_64-pc-linux-gnu)
Ubuntu 17.10

--comand flag error

$ context-color --command "date"
Illegal option --
/home/user/bin/context-color: 1: eval: ommand: not found

GNU bash, version 4.4.12(1)-release (x86_64-pc-linux-gnu)
ubuntu 17.10

Disallow certain colors

I use black backgrounds, but it's possible to get black foreground context colors, which makes text hard to read. Is it possible to avoid black?

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.