You are not logged in.

#1 2016-08-31 18:52:20

nature
Member
Registered: 2016-08-31
Posts: 4

[SOLVED] Tmux + st in i3 problems

Hi,

I have a strange warning when I launch tmux as a regular user, here is the warning message :

Couldn't get a file descriptor referring to the console
-bash: [: : integer expression expected

And then my prompt appears, as I need tmux in order to have a scrollback history this bothers me.
Being an i3 user I use "st -e tmux" when I press $mod + enter to open a new terminal.
The problem also appears if I log in one of the tty as a regular user and the launch tmux from there, and doesn't when I "sudo tmux".

A second problem that I have (not related to tmux but to i3 + st) is when I open a new terminal (with $mod + enter) my cursor switch from normal to loading (the circle) for
a few minutes and then go back to normal.

If you need more informations/logs I am at your disposal.

Thanks in advance.

I used Debian for 3 years and recently switched to arch, I really fell in love with it because I can make my config as clean as I want it to be, so any help would be really appreciated.

Last edited by nature (2016-09-02 09:17:48)

Offline

#2 2016-08-31 18:53:18

Alad
Wiki Admin/IRC Op
From: Bagelstan
Registered: 2014-05-04
Posts: 2,421
Website

Re: [SOLVED] Tmux + st in i3 problems

Post your ~/.profile


Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby

Offline

#3 2016-08-31 18:57:38

nature
Member
Registered: 2016-08-31
Posts: 4

Re: [SOLVED] Tmux + st in i3 problems

my .bash_profile :

#
# ~/.bash_profile
#

[[ -f ~/.bashrc ]] && . ~/.bashrc

# Set vim as default editor
export EDITOR=vim

# Add a bin dir inside home to the PATH
export PATH="${PATH}:~/bin"

# Start X11 on longin on tty1
[ -z "$DISPLAY" -a "$(fgconsole)" -eq 1 ] && startx

Offline

#4 2016-09-02 08:01:50

nature
Member
Registered: 2016-08-31
Posts: 4

Re: [SOLVED] Tmux + st in i3 problems

I am really stuck with that. Its been like 5 days since I have this problem, I searched on google and on duckduckgo and found no solutions to this.
So please, if at least someone could point me somewhere where I could get an answer for this, it would already make my day ! smile

Thank you.

Last edited by nature (2016-09-02 08:02:22)

Offline

#5 2016-09-02 08:45:07

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: [SOLVED] Tmux + st in i3 problems

Does the problem exist with terminal emulators other than st?

Offline

#6 2016-09-02 08:56:15

Alad
Wiki Admin/IRC Op
From: Bagelstan
Registered: 2014-05-04
Posts: 2,421
Website

Re: [SOLVED] Tmux + st in i3 problems

Try replacing:

[ -z "$DISPLAY" -a "$(fgconsole)" -eq 1 ] && startx

with

if [ -z "$DISPLAY" ] && [ "$(fgconsole)" -eq 1 ]; then
  startx
fi

Side note, don't use quotes to set your PATH like that, as it would take the "~" literally (causing issues with find e.a.)

A second problem that I have (not related to tmux but to i3 + st) is when I open a new terminal (with $mod + enter) my cursor switch from normal to loading (the circle) for
a few minutes and then go back to normal.

It should be a single minute. See:

https://wiki.archlinux.org/index.php/I3 … iting_mode


Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby

Offline

#7 2016-09-02 09:17:21

nature
Member
Registered: 2016-08-31
Posts: 4

Re: [SOLVED] Tmux + st in i3 problems

Wow thanks alot, everything is fixed now !

Would you mind if I asked you some explanation on what the problem was ? (for the first one)

Offline

#8 2016-09-02 15:46:27

Alad
Wiki Admin/IRC Op
From: Bagelstan
Registered: 2014-05-04
Posts: 2,421
Website

Re: [SOLVED] Tmux + st in i3 problems

nature wrote:

Wow thanks alot, everything is fixed now !

Would you mind if I asked you some explanation on what the problem was ? (for the first one)

https://github.com/koalaman/shellcheck/wiki/SC2166

The version on the wiki had the same error (oops), but it's fixed now. big_smile


Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby

Offline

#9 2016-09-02 15:55:23

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: [SOLVED] Tmux + st in i3 problems

Now I've written this long ass introduction into bash tests for you and realized I had overlooked you actually had -a in there.

Short answer:

man test wrote:

EXPRESSION1 -a EXPRESSION2
              both EXPRESSION1 and EXPRESSION2 are true

It would have probably been enough to move that one double quote to the right:

[ -z "$DISPLAY" -a "$(fgconsole) -eq 1" ] && startx

[ -z EXPRESSION -a EXPRESSION ]

"$(fgconsole)" -eq 1 are two expressions (as far as test is concerned, so you need to turn it into one, like "$(fgconsole) -eq 1".

[ -z $NOSECHEESE -a "$(echo 2) -eq 2" ]  && date 

... works just fine, while ...

[ -z $NOSECHEESE -a "$(echo 2)" -eq 2 ]  && date 

... throws that error of yours.

However, since you already managed to wrangle a bug into a simple test, Alad showed you how to avoid such problems, by writing clean and readable code. Everybody who will ever read this code, including all of your future selves, will thank you.

The bash test equivalent of "HC SVNT DRACONES".

Last edited by Awebb (2016-09-02 15:57:51)

Offline

Board footer

Powered by FluxBB