Giter VIP home page Giter VIP logo

Comments (31)

arl avatar arl commented on May 26, 2024

Which version of tmux and tmux-gitbar do you use?
A quite similar issue was already reported and fixed, see #13

In case you are using a version pre 1.0.0, you should update it, just be aware of the very light breaking change , described in the README

Thanks for reporting.

from tmux-gitbar.

 avatar commented on May 26, 2024

I just pulled from master today after discovering the project. Which is awesome by the way.

I am running tmux 2.0

from tmux-gitbar.

 avatar commented on May 26, 2024

It does only happen outside of git working directories as mentioned in #13

from tmux-gitbar.

arl avatar arl commented on May 26, 2024

Ok so in this case I confirm the issue and will investigate.
Could you please attach here you tmux.conf or copy paste it please.?
For the rest, you have the default settings right, default tmux-gitbar.conf?

from tmux-gitbar.

 avatar commented on May 26, 2024

yes default tmux-gitbar.conf

Below is my tmux.conf. Pretty simple, I have kinda just used the same configuration with minor tweaks that I made a year ago when I first discovered tmux. Don't make fun of any stupidities lol.

unbind C-b
unbind [
unbind p
unbind o
unbind l
unbind u
unbind o
unbind i
unbind j
unbind k
unbind l
set -g prefix C-a
bind C-a send-prefix
set -sg escape-time 1
set -sg base-index 1
set -g default-terminal "screen-256color"
setw -g mode-keys vi
setw -g pane-base-index 1
bind = split-window -h
bind - split-window -v
bind R source-file ~/.tmux.conf \; display "Reloaded!"
bind Escape copy-mode
bind p paste-buffer
bind o choose-buffer
bind -t vi-copy 's' begin-selection
bind -t vi-copy 'c' copy-selection
bind C-c run "tmux save-buffer - | xclip -i -sel clipboard"
bind C-v run "tmux set-buffer \"$(xclip -o -sel clipboard)\"; tmux paste-buffer"
bind l pipe-pane -o "cat >>~/Desktop/tmux_log.txt" \; display "Toggled logging to Desktop"
bind -r j resize-pane -L 10
bind -r l resize-pane -R 10
bind -r u resize-pane -U 10
bind -r o resize-pane -D 10
bind i swap-pane -U
bind k swap-pane -D
source-file "$HOME/.tmux-gitbar/tmux-gitbar.tmux"

EDIT: Aha! Thanks for pointing out the triple tick.

from tmux-gitbar.

arl avatar arl commented on May 26, 2024

When inside tmux, could you please show me the output of:

echo $TERM

from tmux-gitbar.

 avatar commented on May 26, 2024
~$ echo $TERM
screen-256color
bad colour: fg=white,bg=black
bad colour: fg=white,bg=black
~$ 

from tmux-gitbar.

arl avatar arl commented on May 26, 2024

Thanks for your help in resolving this issue.
Still when inside tmux, you have the default green status bar, right?
And if you run this, what happens:

tmux set -g status-bg black

from tmux-gitbar.

 avatar commented on May 26, 2024

I have the default green.

When running

tmux set -g status-bg black

The status bar changes to grey but the bad colour output continues.

from tmux-gitbar.

arl avatar arl commented on May 26, 2024

The status bar changes to grey but the bad colour output continues.

Yes but it should change to black, not grey.
I suspect a color configuration problem of your tmux.conf, your terminal configuration, or environment variables (through .bashrc).
I also have this line in my tmux.conf, I'm on Ubuntu with gnome-terminal, guake works fine also, as other terminals I tried:

set -g default-terminal "screen-256color"

Maybe this could help?

Now I remember having problems myself to set the tmux color configuration myself.
I have this line in my .bashrc though:

export TERM=xterm-256color

Sorry to not be clearer about that but I found the correct setting after some trial and errors and don't remember which one finally worked!

from tmux-gitbar.

arl avatar arl commented on May 26, 2024

Sorry but the tmux-gitbar status bar is displayed correctly when inside a working tree?

from tmux-gitbar.

 avatar commented on May 26, 2024

Yes it works correctly inside a working tree.

I added

export TERM=xterm-256color

to my .bashrc. Something I had before but not on my new installation. I have also tried suggestions in those posts, but the issue persists. Perhaps I'll keep poking around.

from tmux-gitbar.

 avatar commented on May 26, 2024

I've tried other terminals, but I still get the error.

I tried removing

set -g default-terminal "screen-256color"

but it still didn't work.

Is it worth mentioning that the first time the error is thrown it actually reads:

bad colour: fg=white,bg=black,bright
bad colour: fg=white,bg=black,bright

And then all subsequent errors are just

bad colour: fg=white,bg=black
bad colour: fg=white,bg=black

from tmux-gitbar.

arl avatar arl commented on May 26, 2024

Ok. Update me if you find anything so that I can fix or update the README.
I'll keep looking as well for a way to reproduce.
Le 9 mars 2016 19:05, "aizimmer" [email protected] a รฉcrit :

I've tried other terminals, but I still get the error.

I tried removing

set -g default-terminal "screen-256color"

but it still didn't work.

Is it worth mentioning that the first time the error is thrown it actually
reads:

bad colour: fg=white,bg=black,bright
bad colour: fg=white,bg=black,bright

And then all subsequent errors are just

bad colour: fg=white,bg=black
bad colour: fg=white,bg=black

โ€”
Reply to this email directly or view it on GitHub
#23 (comment)
.

from tmux-gitbar.

 avatar commented on May 26, 2024

Ha okay so I was cruising around different ways of specifying colors in tmux, and landed on trying colorXXX notation.

So for example in my tmux-gitbar.conf I set

readonly TMGB_BG_COLOR='color232'
readonly TMGB_FG_COLOR='color255'

What happened is the inverse of the bug. The functionality of your script isn't changed and I still get live updates to the working tree. But now outside of a working tree the errors go away, except inside a working directory I get

bad colour: color255
bad colour: color232

And then when leaving the working directory I get the one time

bad colour: bright
bad colour: bright

I think you were right before in that this is a versioning issue. What version of tmux do you run?

from tmux-gitbar.

 avatar commented on May 26, 2024

Further information.

Using hex notation in my .tmux.conf produces correct colors (i.e. "#000000" for black). But then the bad colour error becomes

bad colour: fg=colour231,bg=colour16
bad colour: fg=colour231,bg=colour16

OUTSIDE of working trees.

I believe tmux dropped the English spelling "colour" in 1.9 for the American spelling "color". Though using hex is backwards compatible.

EDIT: This is with hex notation in both .tmux.conf and tmux-gitbar.conf. Changing tmux-gitbar.conf back to defaults produces the original error.

from tmux-gitbar.

 avatar commented on May 26, 2024

Ok I found something...the issue is with the save_statusbar amd reset_statusbar functions, and it might be out of your control.

Maybe I'm just being too lazy to find it but where do you set that "TMGB_STATUS_LOCATION" variable. Because I see you are also explicitly following it with 'fg' or 'bg'

from tmux-gitbar.

arl avatar arl commented on May 26, 2024

Interesting
It's tested on tmux 2.1 built from source and 1.9 from ubuntu standard apt
repo.
I'll look into that
Don't think I've time tonight tough
Thanks for the update
Le 9 mars 2016 20:42, "aizimmer" [email protected] a รฉcrit :

Ha okay so I was cruising around different ways of specifying colors in
tmux, and landed on trying colorXXX notation.

So for example in my tmux-gitbar.conf I set

readonly TMGB_BG_COLOR='color232'
readonly TMGB_FG_COLOR='color255'

What happened is the inverse of the bug. The functionality of your script
isn't changed and I still get live updates to the working tree. But now
outside of a working tree the errors go away, except inside a working
directory I get

bad colour: color255
bad colour: color232

And then when leaving the working directory I get the one time

bad colour: bright
bad colour: bright

I think you were right before in that this is a versioning issue. What
version of tmux do you run?

โ€”
Reply to this email directly or view it on GitHub
#23 (comment)
.

from tmux-gitbar.

arl avatar arl commented on May 26, 2024

TMGB_STATUS_LOCATION is set in tmux-gitbar.conf

Le 9 mars 2016 21:36, "Aurelien RAINONE" [email protected] a
รฉcrit :

Interesting
It's tested on tmux 2.1 built from source and 1.9 from ubuntu standard
apt repo.
I'll look into that
Don't think I've time tonight tough
Thanks for the update

Le 9 mars 2016 20:42, "aizimmer" [email protected] a รฉcrit :

Ha okay so I was cruising around different ways of specifying colors in
tmux, and landed on trying colorXXX notation.

So for example in my tmux-gitbar.conf I set

readonly TMGB_BG_COLOR='color232'
readonly TMGB_FG_COLOR='color255'

What happened is the inverse of the bug. The functionality of your
script isn't changed and I still get live updates to the working tree. But
now outside of a working tree the errors go away, except inside a working
directory I get

bad colour: color255
bad colour: color232

And then when leaving the working directory I get the one time

bad colour: bright
bad colour: bright

I think you were right before in that this is a versioning issue. What
version of tmux do you run?

โ€”
Reply to this email directly or view it on GitHub.

from tmux-gitbar.

 avatar commented on May 26, 2024

TMGB_STATUS_LOCATION is set in tmux-gitbar.conf

Oh duh, ha.

Well the issue appears to be reset_statusbar getting bad data from save_statusbar. I am able to work around the issue by switching off readonly on TMGB_OUTREPO_FG_COLOR and TMGB_OUTREPO_BG_COLOR. And then in the reset_statusbar function explicity setting them to "default"

from tmux-gitbar.

arl avatar arl commented on May 26, 2024

Thanks a lot get to the bottom of this. Still, I'm not sure I understand why. Looking at tmux changelogs I found nothing of interest.
I'll compile tmux 2.0 and try to reproduce, I'll hopefully be able to provide a backward-forward compatible fix, as I'd not like to have to add some code switches, depending on the version of tmux

from tmux-gitbar.

 avatar commented on May 26, 2024

I am unsure but the tmux built-in 'default' might actually represent whatever is in the user's rc file. Which could in theory make the whole save_statusbar function unnecessary.

Though I am speaking entirely from speculation, as it is working for me sure enough, but I can't verify backwards compatibility.

from tmux-gitbar.

arl avatar arl commented on May 26, 2024

I am unsure but the tmux built-in 'default' might actually represent whatever is in the user's rc file. Which could in theory make the whole save_statusbar function unnecessary.

For the style attribute, or fg and bg: default means the default color of your terminal. It's not what is in the user rc file.

from tmux-gitbar.

arl avatar arl commented on May 26, 2024

From tmux changelogs:

Deprecated Changes

  • The various foo-{fg,bg,attr} commands have been deprecated and replaced
    with equivalent foo-style option instead. Currently this is still
    backwards-compatible, but will be removed over time.

So I came up with this PR #24 (not merged for now) that replaces this deprecated syntax. It hopefully will fix the issue you have ๐Ÿ˜ƒ
If you happen to have the time to pull it and see if that fixes the issue, I'd be eternally grateful!
Didn't have the time to try on a tmux v2.0

from tmux-gitbar.

 avatar commented on May 26, 2024

Will do

from tmux-gitbar.

arl avatar arl commented on May 26, 2024

๐Ÿ‘

from tmux-gitbar.

 avatar commented on May 26, 2024

Looks good so far. Well done my friend

from tmux-gitbar.

arl avatar arl commented on May 26, 2024

๐ŸŽ‰ Good news!
I'll use this branch myself at home, on tmux 1.9 and tomorrow at work, where I've got tmux 2.1.
If you and I do not see some any problems after having used it, I'll merge this into master.

Thanks again for your contribution, my way to reward you is a comment line in the source code!
14d8290 ๐ŸŽ

๐Ÿ˜ƒ

from tmux-gitbar.

 avatar commented on May 26, 2024

I just compiled 2.1 on my work computer (where I've been tinkering) and am not seeing any issues so far. I'll defer to your best judgment though, for more in depth testing.

from tmux-gitbar.

arl avatar arl commented on May 26, 2024

Ha ok, well done!
There's not so much to test honestly, but tinkering with different sessions, paths (in/out of git), trying with different tmux status string configurations (tmux.conf)
tmux-gitbar has a unit-test suite, but that doesn't include yet this kind of tests. However I'm currently working on a integration test suite that work with a VT100 terminal emulator, with colors! When this will be ready, all of this will be automatically testable. But for now, let's wait until tomorrow and I'll merge this if nothing hapens.

from tmux-gitbar.

arl avatar arl commented on May 26, 2024

I merged #24

from tmux-gitbar.

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.