cf989546379beed27130a88d63eb3ec99aeabbb7
[crypto.git] / apps / irssi / docs / startup-HOWTO.txt
1 Startup HOWTO
2
3   To new Irssi users (not to new IRC users ..)
4
5    Copyright (c) 2000-2001 by Timo Sirainen
6
7    Index with some FAQ questions that are answered in the chapter:
8     1. For all the lazy people
9     2. Basic user interface usage
10     3. Server and channel automation
11           + how do I automatically connect to servers at startup?
12           + how do I automatically join to channels at startup?
13     4. Setting up windows and automatically restoring them at startup
14     5. Status and msgs windows & message levels
15           + I want /WHOIS to print reply to current window
16           + I want all messages to go to one window, not create new
17             windows
18     6. How support for multiple servers works in irssi
19           + I connected to some server that doesn't respond and now irssi
20             keeps trying to reconnect to it again and again, how can I
21             stop it??
22           + I want to have own status and/or msgs window for each servers
23     7. /LASTLOG and jumping around in scrollback
24           + How can I save all texts in a window to file?
25     8. Logging
26     9. Proxies and IRC bouncers
27    10. Irssi's settings
28
29   1. For all the lazy people
30
31    These settings should give you pretty good defaults (the ones I use):
32
33    I don't like automatic query windows, I don't like status window, I do
34    like msgs window where all messages go:
35      /SET autocreate_own_query OFF
36      /SET autocreate_query_level DCCMSGS
37      /SET use_status_window OFF
38      /SET use_msgs_window ON
39
40    Disable automatic window closing when /PARTing channel or /UNQUERYing
41    query:
42      /SET autoclose_windows OFF
43      /SET reuse_unused_windows ON
44
45    And example how to add servers:
46
47    (openprojects network, identify with nickserv and wait for 2 seconds
48    before joining channels)
49      /IRCNET ADD -autosendcmd "/^msg nickserv ident pass;wait -opn 2000" opn
50
51    Then add some servers to different networks (ircnet is already set up
52    for them), irc.kpnqwest.fi is used by default for IRCNet but if it
53    fails, irc.funet.fi is tried next:
54      /SERVER ADD -auto -ircnet ircnet irc.kpnqwest.fi 6667
55      /SERVER ADD -ircnet ircnet irc.funet.fi 6667
56      /SERVER ADD -auto -ircnet efnet efnet.cs.hut.fi 6667
57
58    Automatically join to channels after connected to server, send op
59    request to bot after joined to efnet/#irssi:
60      /CHANNEL ADD -auto #irssi ircnet
61      /CHANNEL ADD -auto -bots *!*bot@host.org -botcmd "/^msg $0 op pass"
62                   #irssi efnet
63
64    If you want lines containing your nick to hilight:
65      /HILIGHT nick
66
67   2. Basic user interface usage
68
69    Windows can be scrolled up/down with PgUp and PgDown keys. If they
70    don't work for you, use Meta-p and Meta-n keys. For jumping to
71    beginning or end of the buffer, use /SB HOME and /SB END commands.
72
73    By default, irssi uses "hidden windows" for everything. Hidden window
74    is created every time you /JOIN a channel or /QUERY someone. There's
75    several ways you can change between these windows:
76      Meta-1, Meta-2, .. Meta-0 - Jump directly between windows 1-10
77      Meta-q .. Meta-o          - Jump directly between windows 11-19
78      /WINDOW <number>          - Jump to any window with specified number
79      Ctrl-P, Ctrl-N            - Jump to previous / next window
80
81    Clearly the easiest way is to use Meta-number keys. And what is the
82    Meta key? For some terminals, it's the same as ALT. If you have
83    Windows keyboard, it's probably the left Windows key. If they don't
84    work directly, you'll need to set a few X resources (NOTE: these work
85    with both xterm and rxvt):
86      XTerm*eightBitInput:   false
87      XTerm*metaSendsEscape: true
88
89    With rxvt, you can also specify which key acts as Meta key. So if you
90    want to use ALT instead of Windows key for it, use:
91      rxvt*modifier: alt
92
93    You could do this by changing the X key mappings:
94     xmodmap -e "keysym Alt_L = Meta_L Alt_L"
95
96    And how exactly do you set these X resources? For Debian, there's
97    /etc/X11/Xresources/xterm file where you can put them and it's read
98    automatically when X starts. ~/.Xresources and ~/.Xdefaults files
99    might also work. If you can't get anything else to work, just
100    copy&paste those lines to ~/.Xresources and directly call "xrdb -merge
101    ~/.Xresources" in some xterm. The resources affect only the new xterms
102    you start, not existing ones.
103
104    Many windows SSH clients also don't allow usage of ALT. One excellent
105    client that does allow is putty, you can download it from
106    http://www.chiark.greenend.org.uk/~sgtatham/putty/.
107
108    Irssi also supports split windows, they've had some problems in past
109    but I think they should work pretty well now :) Here's some commands
110    related to them:
111      /WINDOW NEW                    - Create new split window
112      /WINDOW NEW HIDE               - Create new hidden window
113      /WINDOW CLOSE                  - Close split or hidden window
114
115      /WINDOW HIDE [<number>|<name>] - Make the split window hidden window
116      /WINDOW SHOW <number>|<name>   - Make the hidden window a split window
117
118      /WINDOW SHRINK [<lines>]       - Shrink the split window
119      /WINDOW GROW [<lines>]         - Grow the split window
120      /WINDOW BALANCE                - Balance the sizes of all split windows
121
122    By default, irssi uses "sticky windowing" for split windows. This
123    means that windows created inside one split window cannot be moved to
124    another split window without some effort. For example you could have
125    following window layout:
126      Split window 1: win#1 - Status window, win#2 - Messages window
127      Split window 2: win#3 - ircnet/#channel1, win#4 - ircnet/#channel2
128      Split window 3: win#5 - efnet/#channel1, win#6 - efnet/#channel2
129
130    When you are in win#1 and press ALT-6, irssi jumps to split window #3
131    and moves the efnet/#channel2 the active window.
132
133    With non-sticky windowing the windows don't have any relationship with
134    split windows, pressing ALT-6 in win#1 moves win#6 to split window 1
135    and sets it active, except if win#6 was already visible in some other
136    split window irssi just changes to that split window. This it the way
137    windows work with ircii, if you prefer it you can set it with
138      /SET autostick_split_windows OFF
139
140    Each window can have multiple channels, queries and other "window
141    items" inside them. If you don't like windows at all, you disable
142    automatic creating of them with
143      /SET autocreate_windows OFF
144
145    If you want to group only some channels or queries in one window, use
146      /JOIN -window #channel
147      /QUERY -window nick
148
149   3. Server and channel automation
150
151    Irssi's multiple IRC network support is IMHO very good - at least
152    compared to other clients :) Even if you're only in one IRC network
153    you should group all your servers to be in the same IRC network as
154    this helps with reconnecting if your primary server breaks and is
155    probably useful in some other ways too :) For information how to
156    actually use irssi correctly with multiple servers see the chapter 6.
157
158    First you need to have your IRC network set, use /IRCNET command to
159    see if it's already there. If it isn't, use /IRCNET ADD yourircnet. To
160    make Irssi work properly with different IRC networks, you might need
161    to give some special settings to /IRCNET ADD, see manual.txt for more
162    information about them. Irssi defaults to IRCNet's behaviour.
163
164    After that you need to add your servers. For example:
165      /SERVER ADD -auto -ircnet ircnet irc.kpnqwest.fi 6667
166      /SERVER ADD -auto -ircnet worknet irc.mycompany.com 6667 password
167
168    The -auto option specifies that this server is automatically connected
169    at startup. You don't need to make more than one server with -auto
170    option to one IRC network, other servers are automatically connected
171    in same network if the -auto server fails.
172
173    And finally channels:
174      /CHANNEL ADD -auto -bots *!*bot@host.org -botcmd "/^msg $0 op pass"
175                   #irssi efnet
176      /CHANNEL ADD -auto #secret ircnet password
177
178    -bots and -botcmd should be the only ones needing a bit of explaining.
179    They're used to send commands automatically to bot when channel is
180    joined, usually to get ops automatically. You can specify multiple bot
181    masks with -bots option separated with spaces (and remember to quote
182    the string then). The $0 in -botcmd specifies the first found bot in
183    the list. If you don't need the bot masks (ie. the bot is always with
184    the same nick, like chanserv) you can give only the -botcmd option and
185    the command is always sent.
186
187   4. Setting up windows and automatically restoring them at startup
188
189    First connect to all the servers, join the channels and create the
190    queries you want. If you want to move the windows or channels around
191    use commands:
192      /WINDOW MOVE LEFT/RIGHT/number    - move window elsewhere
193      /WINDOW ITEM MOVE <number>|<name> - move channel/query to another window
194
195    When everything looks the way you like, use /LAYOUT SAVE command (and
196    /SAVE, if you don't have autosaving enabled) and when you start irssi
197    next time, irssi remembers the positions of the channels, queries and
198    everything. This "remembering" doesn't mean that simply using /LAYOUT
199    SAVE would automatically make irssi reconnect to all servers and join
200    all channels, you'll need the /SERVER ADD -auto and /CHANNEL ADD -auto
201    commands to do that.
202
203    If you want to change the layout, you just rearrange the layout like
204    you want it and use /LAYOUT SAVE again. If you want to remove the
205    layout for some reason, use /LAYOUT RESET.
206
207   5. Status and msgs windows & message levels
208
209    By default, all the "extra messages" go to status window. This means
210    pretty much all messages that don't clearly belong to some channel or
211    query. Some people like it, some don't. If you want to remove it, use
212      /SET use_status_window OFF
213
214    This doesn't have any effect until you restart irssi. If you want to
215    remove it immediately, just /WINDOW CLOSE it.
216
217    Another common window is "messages window", where all private messages
218    go. By default it's disabled and query windows are created instead. To
219    make all private messages go to msgs window, say:
220      /SET use_msgs_window ON
221      /SET autocreate_query_level DCCMSGS  (or if you don't want queries to
222                                            dcc chats either, say NONE)
223
224    use_msgs_window either doesn't have any effect until restarting irssi.
225    To create it immediately say:
226      /WINDOW NEW HIDE     - create the window
227      /WINDOW NAME (msgs)  - name it to "(msgs)"
228      /WINDOW LEVEL MSGS   - make all private messages go to this window
229      /WINDOW MOVE 1       - move it to first window
230
231    Note that neither use_msgs_window nor use_status_window have any
232    effect at all if /LAYOUT SAVE has been used.
233
234    This brings us to message levels.. What are they? All messages that
235    irssi prints have one or more "message levels". Most common are PUBLIC
236    for public messages in channels, MSGS for private messages and CRAP
237    for all sorts of messages with no real classification. You can get a
238    whole list of levels with
239      /HELP levels
240
241    Status window has message level "ALL -MSGS", meaning that all
242    messages, except private messages, without more specific place go to
243    status window. The -MSGS is there so it doesn't conflict with messages
244    window.
245
246   6. How support for multiple servers works in irssi
247
248    ircii and several other clients support multiple servers by placing
249    the connection into some window. IRSSI DOES NOT. There is no required
250    relationship between window and server. You can connect to 10 servers
251    and manage them all in just one window, or join channel in each one of
252    them to one sigle window if you really want to. That being said,
253    here's how you do connect to new server without closing the old
254    connection:
255      /CONNECT irc.server.org
256
257    Instead of the /SERVER which disconnects the existing connection. To
258    see list of all active connections, use /SERVER without any
259    parameters. You should see a list of something like:
260      -!- IRCNet: irc.telia.fi:6667 (IRCNet)
261      -!- OPN: tolkien.openprojects.net:6667 (OPN)
262      -!- RECON-1: 192.168.0.1:6667 () (02:59 left before reconnecting)
263
264    Here you see that we're connected to IRCNet and OPN networks. The the
265    IRCNet at the beginning is called the "server tag" while the (IRCnet)
266    at the end shows the IRC network. Server tag specifies unique tag to
267    refer to the server, usually it's the same as the IRC network. When
268    the IRC network isn't known it's some part of the server name. When
269    there's multiple connections to same IRC network or server, irssi adds
270    a number after the tag so there could be ircnet, ircnet2, ircnet3 etc.
271
272    Server tags beginning with RECON- mean server reconnections. Above we
273    see that connection to server at 192.168.0.1 wasn't successful and
274    irssi will try to connect it again in 3 minutes.
275
276    To disconnect one of the servers, or to stop irssi from reconnecting,
277    use
278      /DISCONNECT ircnet   - disconnect server with tag "ircnet"
279      /DISCONNECT recon-1  - stop trying to reconnect to RECON-1 server
280      /RMRECONNS           - stop all server reconnections
281
282      /RECONNECT recon-1   - immediately try reconnecting back to RECON-1
283      /RECONNECT ALL       - immediately try reconnecting back to all
284                             servers in reconnection queue
285
286    Now that you're connected to all your servers, you'll have to know how
287    to specify which one of them you want to use. One way is to have an
288    empty window, like status or msgs window. In it, you can specify which
289    server to set active with
290      /WINDOW SERVER tag    - set server "tag" active
291      Ctrl-X                - set the next server in list active
292
293    When the server is active, you can use it normally. When there's
294    multiple connected servers, irssi adds [servertag] prefix to all
295    messages in non-channel/query messages so you'll know where it came
296    from.
297
298    Several commands also accept -servertag option to specify which server
299    it should use:
300      /MSG -tag nick message
301      /JOIN -tag #channel
302      /QUERY -tag nick
303
304    /MSG tab completion also automatically adds the -tag option when nick
305    isn't in active server.
306
307    Window's server can be made sticky. When sticky, it will never
308    automatically change to anything else, and if server gets
309    disconnected, the window won't have any active server. When the server
310    gets connected again, it is automatically set active in the window. To
311    set the window's server sticky use
312      /WINDOW SERVER -sticky tag
313
314    This is useful if you wish to have multiple status or msgs windows,
315    one for each server. Here's how to do them (repeat for each server)
316      /WINDOW NEW HIDE
317      /WINDOW NAME (status)
318      /WINDOW LEVEL ALL -MSGS
319      /WINDOW SERVER -sticky ircnet
320
321      /WINDOW NEW HIDE
322      /WINDOW NAME (msgs)
323      /WINDOW LEVEL MSGS
324      /WINDOW SERVER -sticky ircnet
325
326   7. /LASTLOG and jumping around in scrollback
327
328    /LASTLOG command can be used for searching texts in scrollback buffer.
329    Simplest usages are
330      /LASTLOG word     - print all lines with "word" in them
331      /LASTLOG word 10  - print last 10 occurances of "word"
332      /LASTLOG -topics  - print all topic changes
333
334    If there's more lines to be printed than 1000, irssi doesn't thinks
335    that you probably made some mistake and won't print them without
336    -force option. If you want to save the full lastlog to file, use
337      /LASTLOG -file ~/irc.log
338
339    With -file option you don't need -force even if there's more than 1000
340    lines. /LASTLOG has a lot of other options too, see /HELP lastlog for
341    details.
342
343    Once you've found the lines you were interested in, you might want to
344    check the discussion around them. Irssi has /SCROLLBACK (or alias /SB)
345    command for jumping around in scrollback buffer. Since /LASTLOG prints
346    the timestamp when the message was originally printed, you can use /SB
347    GOTO hh:mm to jump directly there. To get back to the bottom of
348    scrollback, use /SB END command.
349
350   8. Logging
351
352    Irssi can automatically log important messages when you're set away
353    (/AWAY reason). When you set yourself unaway (/AWAY), the new messages
354    in away log are printed to screen. You can configure it with:
355      /SET awaylog_level MSGS HILIGHT     - Specifies what messages to log
356      /SET awaylog_file ~/.irssi/away.log - Specifies the file to use
357
358    Easiest way to start logging with Irssi is to use autologging. With it
359    Irssi logs all channels and private messages to specified directory.
360    You can turn it on with
361      /SET autolog ON
362
363    By default it logs pretty much everything execept CTCPS or CRAP
364    (/WHOIS requests, etc). You can specify the logging level yourself
365    with
366      /SET autolog_level ALL -CRAP -CLIENTCRAP -CTCPS (this is the default)
367
368    By default irssi logs to ~/irclogs/<servertag>/<target>.log. You can
369    change this with
370      /SET autolog_path ~/irclogs/$tag/$0.log (this is the default)
371
372    The path is automatically created if it doesn't exist. $0 specifies
373    the target (channel/nick). You can make irssi automatically rotate the
374    logs by adding date/time formats to the file name. The formats are in
375    "man strftime" format. For example
376      /SET autolog_path ~/irclogs/%Y/$tag/$0.%m-%d.log
377
378    For logging only some specific channels or nicks, see /HELP log
379
380   9. Proxies and IRC bouncers
381
382    Irssi supports connecting to IRC servers via a proxy. All proxies have
383    these settings in common:
384      /SET use_proxy ON
385      /SET proxy_address <Proxy host address>
386      /SET proxy_port <Proxy port>
387
388    HTTP proxy
389
390    Use these settings with HTTP proxies:
391      /SET -clear proxy_password
392      /EVAL SET proxy_string CONNECT %s:%d\n\n
393
394    Irssi proxy
395
396    Irssi contains it's own proxy which you can build giving --with-proxy
397    option to configure. You'll still need to run irssi in a screen to use
398    it though.
399
400    Irssi proxy is a bit different than most proxies, normally proxies
401    create a new connection to IRC server when you connect to it, but with
402    irssi proxy all the clients use the same IRC server connection (a bit
403    like how screen -x works).
404
405    Irssi proxy supports sharing multiple server connections in different
406    ports, like you can share ircnet in port 2777 and efnet in port 2778.
407
408    Usage in proxy side:
409      /LOAD irc_proxy (/LOAD proxy in irssi 0.7.98.3 and older)
410      /SET irssiproxy_password <password>
411      /SET irssiproxy_ports <ircnet>=<port> ... (eg. ircnet=2777 efnet=2778)
412
413    NOTE: you MUST add all the servers you are using to server and ircnet
414    lists with /SERVER ADD and /IRCNET ADD. ..Except if you really don't
415    want to for some reason, and you only use one server connection, you
416    may simply set:
417      /SET irssiproxy_ports *=2777 (irssi 0.7.99 and later only)
418
419    Usage in client side:
420
421    Just connect to the irssi proxy like it is a normal server with
422    password specified in /SET irssiproxy_password. For example:
423      /SERVER ADD -ircnet ircnet my.irssi-proxy.org 2777 secret
424      /SERVER ADD -ircnet efnet my.irssi-proxy.org 2778 secret
425
426    Irssi proxy works fine with other IRC clients as well.
427
428    SOCKS
429    Irssi can be compiled with socks support (--with-socks option to
430    configure), but I don't really know how it works, if at all. /SET
431    proxy settings don't have anything to do with socks however.
432
433    Others
434
435    IRC bouncers usually work like IRC servers, and want a password. You
436    can give it with:
437      /SET proxy_password <password>
438
439    Irssi's default for connect string is
440      /SET proxy_string CONNECT %s %d
441
442    which you can modify according to your bouncer's needs.
443
444   10. Irssi's settings
445
446    You probably don't like Irssi's default settings. I don't like them.
447    But I'm still convinced that they're pretty good defaults. Here's some
448    of them you might want to change (the default value is shown):
449
450    Queries
451
452    /SET autocreate_own_query ON
453           Should new query window be created when you send message to
454           someone (with /msg).
455
456    /SET autocreate_query_level MSGS
457           New query window should be created when receiving messages with
458           this level. MSGS, DCCMSGS and NOTICES levels work currently.
459           You can disable this with /SET -clear autocrate_query_level.
460
461    /SET autoclose_query 0
462           Query windows can be automatically closed after certain time of
463           inactivity. Queries with unread messages aren't closed and
464           active window is neither never closed. The value is given in
465           seconds.
466
467    Windows
468
469    /SET use_msgs_window OFF
470           Create messages window at startup. All private messages go to
471           this window. This only makes sense if you've disabled automatic
472           query windows. Message window can also be created manually with
473           /WINDOW LEVEL MSGS, /WINDOW NAME (msgs).
474
475    /SET use_status_window ON
476           Create status window at startup. All messages that don't really
477           have better place go here, like all /WHOIS replies etc. Status
478           window can also be created manually with /WINDOW LEVEL ALL
479           -MSGS, /WINDOW NAME (status).
480
481    /SET autocreate_windows ON
482           Should we create new windows for new window items or just place
483           everything in one window
484
485    /SET autoclose_windows ON
486           Should window be automatically closed when the last item in
487           them is removed (ie. /PART, /UNQUERY).
488
489    /SET reuse_unused_windows OFF
490           When finding where to place new window item (channel, query)
491           Irssi first tries to use already existing empty windows. If
492           this is set ON, new window will always be created for all
493           window items. This setting is ignored if autoclose_windows is
494           set ON.
495
496    /SET window_auto_change OFF
497           Should Irssi automatically change to automatically created
498           windows - usually queries when someone sends you a message. To
499           prevent accidentally sending text meant to some other
500           channel/nick, Irssi clears the input buffer when changing the
501           window. The text is still in scrollback buffer, you can get it
502           back with pressing arrow up key.
503
504    /SET print_active_channel OFF
505           When you keep more than one channel in same window, Irssi
506           prints the messages coming to active channel as "<nick> text"
507           and other channels as "<nick:channel> text". If this setting is
508           set ON, the messages to active channels are also printed in the
509           latter way.
510
511    /SET window_history OFF
512           Should command history be kept separate for each window.
513
514    User information
515
516    /SET nick
517           Your nick name
518
519    /SET alternate_nick
520           Your alternate nick.
521
522    /SET user_name
523           Your username, if you have ident enabled this doesn't affect
524           anything
525
526    /SET real_name
527           Your real name.
528
529    Server information
530
531    /SET skip_motd OFF
532           Should we hide server's MOTD (Message Of The Day).
533
534    /SET server_reconnect_time 300
535           Seconds to wait before connecting to same server again. Don't
536           set this too low since it usually doesn't help at all - if the
537           host is down, the few extra minutes of waiting won't hurt much.
538
539    /SET lag_max_before_disconnect 300
540           Maximum server lag in seconds before disconnecting and trying
541           to reconnect. This happens mostly only when network breaks
542           between you and IRC server.
543
544    Appearance
545
546    /SET timestamps ON
547           Show timestamps before each message.
548
549    /SET hide_text_style OFF
550           Hide all bolds, underlines, MIRC colors, etc.
551
552    /SET show_nickmode ON
553           Show the nick's mode before nick in channels, ie. ops have
554           <@nick>, voices <+nick> and others < nick>
555
556    /SET show_nickmode_empty ON
557           If the nick doesn't have a mode, use one space. ie. ON:
558           < nick>, OFF: <nick>
559
560    /SET show_quit_once OFF
561           Show quit message only once in some of the channel windows the
562           nick was in instead of in all windows.
563
564    /SET topicbar ON
565           Show the channel's topic in top of screen.
566
567    /SET lag_min_show 100
568           Show the server lag in status bar if it's bigger than this, the
569           unit is 1/100 of seconds (ie. the default value of 100 = 1
570           second).
571
572    /SET indent 10
573           When lines are longer than screen width they have to be split
574           to multiple lines. This specifies how much space to put at the
575           beginning of the line before the text begins. This can be
576           overridden in text formats with %| format.
577
578    /SET activity_hide_targets
579           If you don't want to see window activity in some certain
580           channels or queries, list them here. For example
581           "#boringchannel =bot1 =bot2". If any highlighted text or
582           message for you appears in that window, this setting is ignored
583           and the activity is shown.
584
585    /SET mail_counter ON
586           Show the number of mails in your mbox in status bar. The mbox
587           file is taken from $MAIL environment setting. Only mbox format
588           works for now.
589
590    Nick completion
591
592    /SET completion_auto OFF
593           Automatically complete the nick if line begins with start of
594           nick and the completion character. Learn to use the
595           tab-completion instead, it's a lot better ;)
596
597    /SET completion_char :
598           Completion character to use.