6

I'm an avid user of tmux and irssi. I've been trying to use the nicklist.pl with irssi in tmux with only half success. I'm currently following the instructions here: Running nicklist with irssi using screen inside tmux?

However it doesn't work every time. If I set it up, and then save my irssi configuration, the script (which is in the autorun folder) does not create the tmux pane and setup the nicklist every time I open irssi in tmux. What can I do to make it work every time?

1
  • You may wish to give weechat a try, I find it is like irssi but with more features and saner settings. And directly relevant to you question, you don't have to play with terminal multiplexing to have a nicklist.
    – demure
    Commented Jun 15, 2013 at 14:46

1 Answer 1

7

The solution you link never says that it works "automatically". You need to split the tmux window manually every time. irssi by itself has no way to control the tmux layout (though it can be scripted — see the ending remark).

If you want to automatically start the nicklist FIFO (which means "initiate the output of the nick list" — not including splitting the tmux window and reading the FIFO), add nicklist fifo as a startup command, e.g. via

echo "nicklist fifo" >> ~/.irssi/startup

If you from within the tmux session run the tmux command:

:split-window -h -l 20 'cat ~/.irssi/nicklistfifo'

you will open a new split window on the right side, 20 characters wide, and start reading the nick list therein.

You can write a simple startup script for tmux that automates the last step (starts irssi and splits the window to read the FIFO). Here is a small example:

#!/bin/sh
WNAME="irssi"
if ! tmux -L default attach-session -t ${WNAME}; then
    tmux new-session -d -s ${WNAME} 'irssi'
    tmux split-window -t ${WNAME} -h -l 20 'cat ~/.irssi/nicklistfifo'
    "${0}"
fi

(Perhaps there will be a race condition in nicklist.pl not creating the FIFO in time for the second pane to read it; in that case try adding a sleep 1 or something before cat.)

As a bonus, this script will gracefully attach to an available session if it exists, instead of trying to start a duplicate one.

All tmux actions are available as similar command-line arguments to the tmux binary.


Let's say you set up the panes at a certain terminal size. If you attach to this session from a terminal with differing size, tmux will resize the panes, which will be problematic since

  1. nicklist needs to know the width of the presentation window in order to handle line-breaking and scrolling correctly
  2. the nicklist pane will often get far too small to be usable if you want to be able to handle full screen terminals, 25x80 and other sizes.

If this is something you will do often, see the "Auto update tmux pane size for nicklist.pl" section at Install and setup BitlBee for an irssi plugin that keeps the tmux pane size constant.

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .