You are not logged in.

#1 2010-01-05 07:37:00

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

[SOLVED] tmux starts with errors

I've just started using tmux and am quite impressed. One oddity though, whenever I start tmux - or open a new window or pane, I get the following printed before the prompt:

-bash: c: command not found
dir: cannot access colours: No such file or directory
-bash: /home/jason/.dir_colors: Permission denied

I don't see this when I open a normal termial (Urxvt or Xterm), only in tmux. I assume it has something to do with my $PATH, but am at a loss to explain it. Anyone else encountered anything like it?

Last edited by jasonwryan (2010-01-06 07:34:30)


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#2 2010-01-05 07:48:52

chpln
Member
From: Australia
Registered: 2009-09-17
Posts: 361

Re: [SOLVED] tmux starts with errors

Using tmux with zsh here without issues.  From the output, I gather you're using bash.  Could you post your .bashrc?

Offline

#3 2010-01-05 07:56:37

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] tmux starts with errors

Thanks chpln

Pasted here: http://pastebin.com/m37a9a8e1


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#4 2010-01-05 08:57:06

chpln
Member
From: Australia
Registered: 2009-09-17
Posts: 361

Re: [SOLVED] tmux starts with errors

Well, I haven't been able to track down anything which would cause those errors.  (I did notice a couple of unrelated things I might as well point out: a typo in `export HISTFILEIZE=' and the aliases `orphans' and `pacback' cause pacman to run when evaluating .bashrc; if this is not what you want, use single-quotes.)

Do you receive any errors when running another instance of `bash' within a shell, both directly within urxvt/xterm and within tmux?  If not, are you using a wrapper script around tmux?  If using a .tmux.conf, does it make a difference to start without it:

/usr/bin/tmux -f /dev/null

Check the read permissions of ~/.dir_colors (if you haven't already), I have a suspicion that is a separate error.

Offline

#5 2010-01-05 09:13:27

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] tmux starts with errors

Thanks for the suggestions.

chpln wrote:

1. Do you receive any errors when running another instance of `bash' within a shell, both directly within urxvt/xterm and within tmux? 
2. If not, are you using a wrapper script around tmux? 
3. If using a .tmux.conf, does it make a difference to start without it:

/usr/bin/tmux -f /dev/null

Check the read permissions of ~/.dir_colors (if you haven't already), I have a suspicion that is a separate error.

1. No - no errors running bash inside Urxvt or tmux
2. I'm not using a wrapper script around tmux
3. Starting without .tmux.conf results in the same errors.

The .dir_colours thing does seem to be a separate issue - it is currently 644 which I thought would work, but the error persists...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#6 2010-01-05 09:52:58

chpln
Member
From: Australia
Registered: 2009-09-17
Posts: 361

Re: [SOLVED] tmux starts with errors

Judging from the spelling of `colours' alone, I too get the feeling it may have to do with something in your PATH.  Does grep'ing through your scripts reveal anything?

Offline

#7 2010-01-05 10:08:19

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] tmux starts with errors

Not really. I had a script called colours.sh - so I deleted it - to no effect. I also have a directory in ~ called .colours so I removed that but that had no impact either.

Thanks for your help with this chpln: it's a trivial annoyance but, like all these things, understanding why it is happening is probably as important as fixing it. I'll keep messing about with it and post any progress...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#8 2010-01-05 21:22:11

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] tmux starts with errors

It is definitely not related to .bashrc - if I remove it tmux still opens with errors - including (the expected?)

-bash: /home/jason/.bashrc: No such file or directory

I still think it is related to my $PATH, but am not sure where else to look...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#9 2010-01-05 21:47:15

chpln
Member
From: Australia
Registered: 2009-09-17
Posts: 361

Re: [SOLVED] tmux starts with errors

jasonwryan wrote:

still opens with errors - including (the expected?)

I wouldn't have expected to see that and I can't reproduce that error with bash.

Bash Info Manual wrote:

When an interactive shell that is not a login shell is started, Bash reads and executes commands from `~/.bashrc', if that file exists.

So, presumably .bashrc is indeed optional, and that error should usually not be triggered.  I still have no idea where the problem could be.  Might be worth testing whether the same thing happens with 'bash --norc', and hunting around some other files which may be sourced by bash on startup (/etc/bash.bashrc, /etc/profile, ~/.bash_profile).

Last edited by chpln (2010-01-05 21:47:56)

Offline

#10 2010-01-05 22:07:03

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] tmux starts with errors

chpln wrote:

Might be worth... hunting around some other files which may be sourced by bash on startup (/etc/bash.bashrc, /etc/profile, ~/.bash_profile).

Bingo! I had this line in /etc/profile

eval `dir colours /home/jason/.dir_colors`

Complete with the anglophone spelling... Commenting it out leaves a single error as tmux starts, the

-bash: c: command not found

I'll keep looking in these files - I am confident that you have cracked it. Thanks!

##edit
Downloaded and installed a fresh /etc/profile and the last error is gone...

Last edited by jasonwryan (2010-01-06 07:35:51)


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB