You are not logged in.

#1 2012-07-05 22:35:35

MoonSwan
Member
From: Great White North
Registered: 2008-01-23
Posts: 881

[solved]How can I run Tmux running within an Fbterm session?

I would like to have fbterm running and within that environment I'd like tmux to start-up so I can use it on an X-less machine I'm configuring.  I love tmux and I'm using this code snippet from the wiki in my .bashrc file which allows me to run Tmux as my first login sesshion:

And this snippet start only one session(unless you start some manually), on login, try attach at first, only create a session if no tmux is running.

# TMUX
if which tmux 2>&1 >/dev/null; then
    #if not inside a tmux session, and if no session is started, start a new session
    test -z "$TMUX" && (tmux attach || tmux new-session)
fi

- I've tried setting my .xinitrc/.bashrc with an "exec fbterm" line.  That does not work and in some cases it crashes and logs me out. 
- I have also tried to just exec fbterm in .xinitrc so that it starts first and then tmux should be up and running but I keep getting an error from fbterm that tmux is not an interactive shell and thus cannot start.

I'm sure theres a simple way of doing this but I don't have the Google-fu to find a solution.  Any help is appreciated!

Last edited by MoonSwan (2012-07-08 01:11:12)

Offline

#2 2012-07-05 23:41:34

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [solved]How can I run Tmux running within an Fbterm session?

If you want an X-less machine, you should forget about .xinitrc.

Can you do this by hand or do you get the interactive shell error too?

Last edited by karol (2012-07-05 23:42:13)

Offline

#3 2012-07-05 23:56:58

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: [solved]How can I run Tmux running within an Fbterm session?

^ what karol said. what happens if right after you login you do

fbterm
tmux

This appears to work for me.

Once you are sure that works, you can start trying to automate it.

Last edited by 2ManyDogs (2012-07-05 23:57:40)

Offline

#4 2012-07-06 17:36:21

MoonSwan
Member
From: Great White North
Registered: 2008-01-23
Posts: 881

Re: [solved]How can I run Tmux running within an Fbterm session?

Well, I tried what you said to try 2ManyDogs,  and after logging in I issued an "fbterm" command.  As it stands, because of that code that tells tmux to start up whenever I do a login shell, after the "fbterm" I do get an frambuffer terminal/shell.  On the plus side, the code then executes Tmux as expected! 

So running fbterm gives me a framebuffered shell and Tmux then executes and runs so I have Tmux within framebuffer shell which is what I want to happen.  But I don't know how to do the next step, automating this task on login.  Hm, so now what?

Off-topic, thank you both for your help, it is deeply appreciated.  smile

Offline

#5 2012-07-06 19:20:58

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: [solved]How can I run Tmux running within an Fbterm session?

(edit) removed non-working suggestion. still researching.

(edit2) this seems to work in my .bashrc:

This seems to work (it's the conditional block you have, with one minor modification):

# TMUX
if which tmux 2>&1 >/dev/null; then
    #if not inside a tmux session, and if no session is started, start fbterm and a new tmux session
    test -z "$TMUX" && fbterm && (tmux attach || tmux new-session)
fi

This also seems to work, without the conditional:

[[ $TERM != "screen" ]] && fbterm && tmux && exit

Last edited by 2ManyDogs (2012-07-06 19:34:46)

Offline

#6 2012-07-08 01:10:53

MoonSwan
Member
From: Great White North
Registered: 2008-01-23
Posts: 881

Re: [solved]How can I run Tmux running within an Fbterm session?

Thank you!  Your very simple method worked and I feel quite embarrassed that it was a simple command addition to the tmux code.   I have found that I have to exit/logout of 3 shells before I get to one without fbterm or tmux being used.  I think that's a small price to pay for success. 

Thank you very much. smile

Offline

#7 2012-07-08 01:12:56

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: [solved]How can I run Tmux running within an Fbterm session?

You're welcome. The exit issue is because you are running tmux inside fbterm inside your login shell (but that's what you asked for smile )

Last edited by 2ManyDogs (2012-07-08 01:13:26)

Offline

#8 2012-07-08 02:57:10

progandy
Member
Registered: 2012-05-17
Posts: 5,199

Re: [solved]How can I run Tmux running within an Fbterm session?

Hi, here is another apporach:
Start fbterm in your .profile with: "SHELL=tmux fbterm" Then fbterm doesn't spawn another shell, but directly tmux which in turn opens the shell. This is the result:
login -> bash -> fbterm -> tmux -> bash
One exit and you are back on your normal bash, another exit and you can login again. Combine it with qingy and you have a completely graphical console wink

Last edited by progandy (2012-07-08 03:13:25)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#9 2012-07-08 03:46:38

MoonSwan
Member
From: Great White North
Registered: 2008-01-23
Posts: 881

Re: [solved]How can I run Tmux running within an Fbterm session?

Wow thanks Progandy!  Your method is a lot closer to what I want and I shall definitely use it.  I like 2ManyDgs approach too but your idea seems better suited to what I want from my shell.

Much thanks!

Offline

Board footer

Powered by FluxBB