This commit removes the `const` qualifier from certain member fields,
as the Darwin version of several `<term.h>` related functions only
accept a `char *` rather than a `const char *`, thereby resulting in
dozens of compiler warnings.
HOST_NOT_FOUND is a gethostbyname(3) error condition rather than a
getaddrinfo(3) error condition and cannot be passed to net_gethosterror
as documented as it calls gai_strerror(3). EAI_NONAME is the appropriate
similar error condition as standardized by POSIX for getaddrinfo(3).
inet_addr has become obsolescent as of POSIX-1.2024 and is not available
on strict POSIX 2024 libc implementations.
inet_pton(3) is the standard and portable replacement available on all
POSIX-1.2001 systems.
This is the header required by POSIX-1.2024.
This change is needed to build irssi on operating systems such as Sortix
that have a strict libc without obsolete behaviors.
when attempting SASL, if multiple CAP ACK were received (for example,
because a script sent an additional CAP REQ), then any not containing
`sasl` would cause SASL to fail (immediately aborting the connection
with no message, depending on sasl_disconnect_on_failure setting)
check not only if SASL is set in this line, but also if we've already
seen it in a previous line.
This commit includes the real `tpus(3)` function from the appropriate
`term.h` header file, if found.
This commit is necessary to fix a compiler warning on Darwin.
This commit removes the unused `len` variable, which gets set quite a
few times, but whose value is totally unused.
This also fixes a compiler warning I get on my Darwin.
When working with channels belonging to other, non-IRC protocols,
calling irc_channel_find() returns NULL, which makes irssi
use IRCTXT_OWN_ACTION_TARGET format, instead of the correct
IRCTXT_OWN_ACTION.
Using generic channel_find() instead fixes the issue.
Printing to STDOUT can interfere with programs which intend to produce
machine-readable output and yet for whatever reason import Irssi.pm from
outside of irssi.
Closes https://github.com/irssi/irssi/issues/1465
This causes subsequent window_item_set_active() check, further
down in the same function, to evaluate correctly, and getting
the action message printed using correct format.
* Changed the messages for /window level and /window immortal to a more
general tone.
Executing both commands without parameter show the current state but
the old messages indicate a change of state.
Signed-off-by: Sven "qoreQyaS" Grewe <git@gucke.net>
On recent FreeBSD systems it is required to include the sys/nv.h file, otherwise symbols are missing.
Reported here: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=265397
Patch suggested by: Kristof Provost <kp@freebsd.org>
Exit safely on SIGTERM by emitting "gui exit" from the main loops of
fe-text and fe-none rather than from the signal handler itself.
Based on feedback from Nei and dwfreed.
This reverts commit 91439c099e1bbf848dac03f67a3239fcc4c1f771;
because it adds handling for numeric 524, which conflicts with
ERR_QUARANTINED and ERR_OPERSPVERIFY.
This patch introduces setting "glib_log_domains", which is
a space-separated list of log domain names, optionally prefixed
with a '-'. The list is parsed from left to right to determine
whether or not user wants to see message from a particular log
domain. Keywords 'all' or '*' are allowed as well.
Examples: "GLib-GIO", "all -GLib-GIO", "-*"
This patch also changes the default format for displaying GLib log
messages to include the log domain.
Add the missing arguments to tparm. X/Open Curses specifies
tparm takes a fixed number of 10 arguments, while ncurses
has implemented it as a varargs function. tiparm is a standardized
version of varargs tparm, support in both NetBSD libcurses and
ncurses, but not by older versions of Solaris.
This is an alternate fix to the one proposed in irssi/irssi/#1305
that should keep compatibility with older versions of Solaris by
avoiding tiparm.
If term.h is present, use that instead of defining prototypes for the
terminfo functions in terminfo-core.c. This causes problems on certain
platforms (e.g. Apple aarch64) due to the functions being prototyped as
non-variadic but called as variadic. If term.h isn't found, it falls
back to the old behaviour.
Fixes#1238.
A change in GLib 2.63 broke some assumptions in Irssi that the null-byte
NUL / U+0000 is a valid Unicode character. This would occur when the
user types Ctrl+Space. As a result, the input loop never manages to
process the NUL-byte (and any other user input that follows, ever).
This patch adds a manual check that properly advances the input loop if
GLib returns -2 (incomplete character) despite the length being positive
and a NUL is in first position.
Fixes#1180https://gitlab.gnome.org/GNOME/glib/-/merge_requests/967https://gitlab.gnome.org/GNOME/glib/-/issues/2093
- the expando values need to be stored now that the lines are
reformattable, otherwise the old values are lost (and they depend on
context only available at the time the line is initially printed)
- the cache is collected from the special-vars evaluation code
- the cache is controlled by the textbuffer-formats code, and stored in
the text_buffer_format_rec
- completely removed the old textbuffer representation (
https://github.com/shabble/irssi-docs/wiki/Notes-256-Colour#textbuffer-encoding
)
- textbuffer-formats is an extra module, so if we unhook the signals it
should go back to the "old way" of storing pre-rendered tex
- design uses cache, original formats and list of arguments
Track the address family of the last failed connection attempt
(either immediately or during TLS handshake), then disprefer
that address family during reconnection.
Most of these have been deprecated since forever (2.2), but they didn't
raise warnings. Now they do, and the warnings are not the most verbose
warnings you could ask for, but, they point in the right direction.
This doesn't handle the GTimeVal deprecation warnings. Those seem
trickier since they cover API, will look into those right after this.
If irssi's preferred nick is in use irssi will issue a whois command and report some information
on the current user of the nick. As the "is owned by" wording can be confusing to users of networks
with nickname registration, propose rephrasing this to "is in use by".
This was causing us to use the TLS settings from one server on another
which is not always appropriate. Instead, we now treat it like other
connection information and do not copy it. We get the TLS settings later
as appropriate when connecting.
Note there is still probably more that could be cleaned up here. For
example, the unix socket might be better treated as connection info too.
Fixes#1027.
This patch allows irc_op_public messages to properly trigger
hilights when the message mentions the current nick or one of our
hilights. This is done by copying the required code from
sig_message_public. This is important because Freenode has begun
using this message type for messages that can only be seen by ops
due to the +z channel mode, and ops will want to be notified of
watchwords even in that type of message.
To test, make two connections to Freenode, join a new channel. The
first client to join that channel will be an op. To establish a
baseline, use the non-opped client to attempt to "ping" the opped
client by addressing it by name and using terms in /hilight. Then,
set channel mode to +mz and use the non-opped client to send the
messages again. Without this patch, no message will "ping" the opped
client with +mz set. With this patch, "pings" should operate
normally, causing a bell, hilighting the window number, and so on.
What I don't know is whether there is any other code from
sig_message_public that should be copied over too. In particular,
the lines related to "ignore_check_plus", "emphasis", and
"printnick", I don't know if they are needed here. I also don't know
if there are any other message types that these changes should be
applied to.
I was misled by the documentation a little bit and thought that status bar items of lower priority will be removed rather than truncated if they didn't fit.
Also, I had a hard time lowering priority below 0 because I didn't realize negative numbers have to be quoted so they won't be interpreted as option flags.
To avoid expanding, tab completion escapes the completion list. But the
escape_string function escapes too much for the expand_escapes code. Add
a function that only escapes the backslashes.
* IBM i rpmbuild environments set the magic variables for
building w/ 64-bit binutils automatically, and one can
set this for themselves with `OBJECT_MODE=64` when
buildings. Remove this.
* The subdir-objects change will need to be made due to
upstream autotools making it mandatory in the future, but
that isn't my decision to make.
* Lots of warnings about subdirectories. Set an automake
option to deal with this.
* Set an ar flag for explicit 64-bit when on IBM i, due to
it defaulting to 64-bit output with official gcc by default.
this was overlooked when adding hidden line support. if the lines are
removed, Irssi has to update the startline. It does that by "scrolling"
the lines to the proper place. The scroll function was adjusted to
calculate 0 for hidden lines, thus it would miss them.
Apple has significantly changed the way `perl` is structured in macOS
Mojave/10.14, which is due to ship stable this month. The `perl`
restructuring has been an issue for a while but I recently obtained
confirmation from Apple the changes were intentional & consequently not
something that was going to be walked back before Mojave reaches its
stable release.
As of 10.14 the Perl headers are moving inside the SDK, instead of
residing in `/System` directly. There's a flag to tell Clang to look
inside the SDK without projects having to explicitly locate the SDK &
fiddle with the location themselves, which is `-iwithsysroot`, and
that's what `perl` outputs now when `configure` checks
`perl -MExtUtils::Embed -e ccopts`:
```
-g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -iwithsysroot /System/Library/Perl/5.18/darwin-thread-multi-2level/CORE
```
The latter bit of that was previously
`-I/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE`. The
problem here is that `configure` filters out flags that start with a
lowercase `i` and consequently the Perl elements fail to build. This
tiny patch fixes that issue, restoring Perl support to `irssi` when
built on macOS 10.14.
As we called the same function for the topic info numeric, we ended up
losing the topic as that numeric does not include it. We now call a
different function to handle this case more carefully. Fixes#903.
Hi folks!
I tried clang-static-analyzer on irssi 1.1.1, it seems like it
finds some things. Here's a diff, but there might be more that you would
want to check, or choose to work differently.
(in special-vars.c, ret is commands->data sometime)
I hope it's not too much trouble if reported as a confidential bug.
Thanks.
This adds a i_wcwidth() function that replaces mk_wcwidth(), and a
'wcwidth_implementation' setting to pick which one it wraps.
Values:
- old: uses our local mk_wcwidth() which implements unicode 5.0
- system: uses the libc-provided wcwidth(), which may be better or worse
than ours depending on how up to date the system is.
- auto: tests the system one against two characters that became
fullwidth in unicode 5.2 and 9.0 respectively. If either of them pass,
pick the system implementation, otherwise pick ours.
It defaults to auto.
mk_wcwidth() is still preferable in some cases, since the way it uses
ranges for fullwidth characters means most CJK blocks are covered even
if their characters didn't exist back then.
The "system" implementation is also wrapped to never return -1, but to
assume those unknown characters use one cell. Quoting the code:
/* Treat all unknown characters as taking one cell. This is
* the reason mk_wcwidth and other outdated implementations
* mostly worked with newer unicode, while glibc's wcwidth
* needs updating to recognize new characters.
*
* Instead of relying on that, we keep the behavior of assuming
* one cell even for glibc's implementation, which is still
* highly accurate and less of a headache overall.
*/
A side-effect of 8deb618 is that `/save` may replace configuration files
that are symlinks with regular files. Fix this by resolving all
symlinks before renaming the temporary file.
Some programs and users send SIGWINCH as a request for the client to redraw
in the event of session detachment/reattachment (e.g. abduco). A well-formed
terminal will only send SIGWINCH when the window size has changed, so there
is no need to optimise this case out.
Fixes#888.
Previously we showed that there was a topic set when using /topic, just
an empty one. This was different than how we show such topics when
initially joining a channel. Now we say that the topic is unset in both
cases.
Don't use errno if it is not set and show the default error message
instead. This prevents messages like "SSL handshake failed: Success"
from being shown.
This is modeled after glib's g_file_set_contents. It doesn't use that
function directly because the writing is done with GIOChannel
streaming-like writes and g_file_set_contents expects the whole thing to
be in-memory.
Main differences with g_file_set_contents:
- complete lack of win32 special casing (cygwin/WSL should work though)
- no fallocate() (linux only, but we don't know the size upfront, anyway)
- always calls fsync (glib skips it on btrfs or when not overwriting)
Other than that, it's the same old mkstemp + fsync + rename.
This is a simple change which might fix#130
The lookup_servers are also disconnected if the lookup/SSL handshake doesn't succeed in time. I'm not perfectly sure if this is the master fix but it does seem to be an issue that servers can be stuck in lookup, especially for SSL. See the issue for a reproducer
This patch adds support for the OTR protocol to irssi. This is an import
of the external irssi-otr project that we are now taking over
maintership for.
Major thanks to the original authors of Irssi-OTR: Uli Meis and David
Goulet. Thanks to the OTR community in #OTR on OFTC, thanks to everyone
who have helped testing the patches and submitted UI suggestions.
Now iterating over all servers to avoid crashes on server_ischannel(),
which is a macro for server->ischannel(), so it dies horribly when it's
null. Doesn't help that IS_IRC_SERVER() always returns true on null.
When pinging two people, typing `nick1<tab> nick2<tab> message` for
autocompletion will get you `nick1: nick2 message`, which is kinda
confusing.
We only insert the colon after the first autocompleted nick,
because if a nick is used in the middle of the sentence it's mentioning
the person but not targeting the message at them.
However, this breaks down when we try to ping a list of people. There
should be a colon in front of each separating the names from the
message. only having a colon at the end of the nick list works too,
but it seems like the IRC convention is to just use multiple colons.
This patch makes it so that autocompleting a nick after a list of
existing autocompleted nicks at the beginning of the message
will include a colon.
this reverts part of #465
unfortunately we need to further refine the initial patch
- when filtering by channel, the whole split is cleaned up nevertheless
- something similar happens for the netjoins
- furthermore, we cannot wait only for PUBLIC msgs, j/p/q are equivalently relevant for temporal integrity
warning:
* may be buggy
This commit adds support for sideways splits into Irssi. To that regard,
there are a number of new commands available
the "R" commands:
/window new rsplit - make a new sideways split
/window rshow - show an existing window to the right
/window rgrow/rshrink/rsize/rbalance
- manipulate the size of your sideways split windows
the "D" commands:
/window dup/ddown/dleft/dright
- navigate the windows directionally, as an alternative to
/window up/down that you can bind to some key
/window move dleft/dright - the same for moving
Enjoy!
Add a new signal, server destroyed, that is supposed to run the clean up
tasks of server disconnected. This is so that some structures will stay
around longer.
Initialize tagtarget on declaration
move code around for better flow, extra checks for uninitialized values
remove unnecessary item->type checks
don't strdup sign
add braces around if statements, use strcmp0 with single characters and remove g_str_has_prefix
refactoring
changed g_ascii_strcasecmp to g_strcmp0
Add networktag/ shorthand
fixed memory leaks
changed from #@= to ::channels, ::queries and ::dccqueries
check for empty string and continue; if found
fixed bug with empty string check
Clean up code
This is to fix#601. The function used to extract the mode string
assumed that ":" would only occur in a particular spot. This lead to the
possibility that ":" could be treated as part of things like nicknames
or mode arguments, where it should have been stripped as part of
protocol escaping.
There may be cases (such as if target or server->nick is very long)
where the split_message function returns NULL, indicating an error. To
avoid a potential segfault, we now check to see if splitmsgs is NULL.
While investigating #317, I noticed that it was possible we would access
an uninitialized buffer due to failing to check the return value of
net_ip2host(). This is done in several places. To make such uses safe,
set the host buffer to an empty string on error. It is possible callers
could be improved by handling the error in each spot, but this gives us
some safety.
it is possible to use Irssi::UI::Window::get_history_entries to save the
history entries, load_history_entries to load entries into the command
history and delete_history_entries to remove history entries (for example
to remove history selectively)
this allows access to the global history even when a using /window history
named or /set window_history on, and you want to recall something from one
of the other windows' histories.
usage (default): ctrl+up/down
Fixes#733. The fix outlined in #452 had adverse effects for the
following reason. The code removed the restoration path that would go on
the code path from kill SIGTSTP. The problem is this: When Irssi is not
running in a controlling parent (like a shell), the TSTP will in fact be
ignored. In that case, there is no process sending a CONT either and
thus the screen state never gets restored. Luckily, the patch in #457 is
sufficient to prevent the problem in #450 (which lead to the development
of #452). To that end, we do end up with potentially calling
terminfo_cont twice but that is better than not calling it at all.
This reverts commit b1ffd5f647, reversing
changes made to 9cb0419435.
This splits sign parsing out of parse_time_interval_uint() so that the
negative sign is applied outside of the unsigned context where the
number parsing is done, and after all the checks that it's lower than
(1 << 31)
This fixes issues with settings like `server_reconnect_time`,
`server_connect_timeout` and `lag_max_before_disconnect`, which accepted
-1 as a valid value.
Perl sucks and kills the whole process when there's a version mismatch
in Perl_xs_handshake(). Our atexit handler catches the exit and
deinitializes the terminal, removing the error.
This commit uses the 'quitting' global variable which is set when irssi
is voluntarily quitting, and avoids sending TI_rmcup, which restores the
original screen and makes the error invisible.
This avoids the use of g_list_find() to find if a match was already
added to the list of results, by checking the last two added matches
instead.
Checking just the last match isn't enough because a NULL match is added
as a separator (shown as -- in the UI)
This applies to "/lastlog" with no filters (or with filters that don't
filter a lot) and with large amounts of text in the scrollback.
Test case:
/exec seq 1 500000
/lastlog -file log.txt
Thanks to morning for reporting this.
The warning itself:
>warning: comparison between pointer and zero character constant [-Wpointer-compare]
Harmless stuff as far as I can tell.
The fix adds a null check that probably isn't needed. The old code that
compared against '\0' worked a lot like a null check so it makes sense
to keep that, while also adding the intended check for empty string.
This was visible with "/dcc close send a" showing an empty filename.
The equivalent for get didn't show the filename in the format string.
Add a more detailed paragraph about service bots
Fixes#699
I would like to add another paragraph about how freenode is
broken and spits at you the whole list instead of empty list
if you attempt to use network side filtering......
Originally found by oss-fuzz (issue 525) in get_ansi_color using ubsan.
After a lot of analysis I'm 99% sure this isn't security relevant so
it's fine to handle this publicly.
The fix is mainly adding a function that does it right and use it
everywhere. This is harder than it seems because the strtol() family of
functions doesn't have the friendliest of interfaces.
Aside from get_ansi_color(), there were other pieces of code that used
the same (out*10+(*in-'0')) pattern, like the parse_size() and
parse_time_interval() functions, which are mostly used for settings.
Those are interesting cases, since they multiply the parsed number
(resulting in more overflows) and they write to a signed integer
parameter (which can accidentally make the uints negative without UB)
Thanks to Pascal Cuoq for enlightening me about the undefined behavior
of parse_size (and, in particular, the implementation-defined behavior
of one of the WIP versions of this commit, where something like signed
integer overflow happened, but it was legal). Also for writing
tis-interpreter, which is better than ubsan to verify these things.
If text is being entered and then the user presses the up arrow
followed by the down arrow, the expected behavior is to return to the
text being entered. Prior to this commit that was not the case.
Fixes#462
In glib v2.49.3, an optimization was made to eliminate certain
unnecessary wakeups. (The specific change was made in
e4ee3079c5afc3c1c3d2415f20c3e8605728f074). Before this change, the
first call to g_main_iteration would always complete immediately.
In Irssi, this effectively reversed the order of the main loop, causing
the reload_config check and the dirty_check to run *before* the first
blocking call to g_main_iteration.
With the new logic, the first g_main_iteration call now blocks,
preventing the screen from being refreshed until the user starts typing
or a timer goes off. (It also delays processing of SIGHUP, but I
expect that is not a common situation.)
This commit reorders the main loop to wait at the end of the loop,
rather than the beginning, addressing the problem.
(This closes Debian bug #856201.)
Commit 6300dfec7 removed the option to disable SSL support from the
configure script since it became a requirement, but it also removed the
use of pkg-config for finding the OpenSSL library and its dependencies.
This had the unfortunate consequence of breaking the correct detection
of library flags in many static linking scenarios. In some cases, for
example, OpenSSL might have been built with zlib, which requires `-lz`
to be passed to the linker when doing a static link of the irssi
executable. Thus, pkg-config becomes an invaluable tool in such
situations, since no guessing work is needed as the OpenSSL .pc file
provides all the necessary flags.
So, this commit re-inserts the PKG_CHECK_MODULES macro in the configure
script when looking for OpenSSL. The test using AC_CHECK_LIB remains,
but only as a last resort in case the one using pkg-config fails.
Also, because the macro AM_PATH_GLIB_2_0 contains an unconditional call
to PKG_PROG_PKG_CONFIG, the OpenSSL checks are moved so that they come
after the Glib ones in order to avoid doubly checking for the pkg-config
binary (PKG_CHECK_MODULES skips that check if it has been performed
before, but PKG_PROG_PKG_CONFIG does not).
The script unloading code originally worked like this:
1. Destroy package
2. Emit 'script destroyed' signal
3. Unhook script's signal handlers
If a script added a 'script destroyed' signal handler, unloading
that script would cause the 'script destroyed' signal to be sent to the
(already destroyed) package. This would cause a script error, which would
trigger a script unload, which would start the whole process over again,
until we run out of heap or stack space and segfault.
This commit simply reorders the operations so that the 'script destroyed'
signal is sent *after* the script is fully destroyed.
PR #453 forces the user to quote the filenames given to /DCC commands
when they contain spaces but the autoget functionality didn't get
updated so the filename was always passed without quotes.
Closes#656.
Mentioning "sb-item" was misleading in that there is no such template,
nor any occurrence of that exact string anywhere else in the source.
In going from `sb-item` to `"sb"` I am following the pattern established
in a couple of comments above:
"msgownnick" specifies the styling …
"ownmsgnick" specifies …
If $PKG_CONFIG contains a space, then the test may not work, so
surround with quotation mark characters. (for example,
PKG_CONFIG="pkg-config --static" breaks configure before this commit).
Use the following configure command:
$ ./configure --with-fuzzer --with-fuzzer-lib=/path/to/libFuzzer.a \
CC=clang CXX=clang++
Places an irssi-fuzz in src/fe-fuzz/ after build.
Also can specify SANFLAGS to override the chosen sanitizer flags
(defaults to "-g -fsanitize=address -fsanitize-coverage=trace-pc-guard").
They have proper certs, so using them as an example is wrong.
Particularly worse since they started using letsencrypt recently so
every server has a different cert and pubkey.
We'll figure out how to link this from the release notes later.
Original patch by 'Slarky'
According to that ticket, the next major version of solaris won't need
this. Consider reverting this when solaris 11.3 stops being relevant.
irssi 1.0.0 will not build if Perl is enabled and a separate
object code directory is used. The problem was a relative path
to an internal Perl dependency in four Makefile.PL.in files.
It was made redundant by the introduction of the pointer to the GRegex
structure.
Silence the compiler warning in textbuffer.c about preg being
initialized by setting it to NULL.
Otherwise we end up with the message in the status window since the
frontend knows jack shit about the casemapping option when it tries to
find the associated window for the query.
This patch moves the emitted "tls handshake finished" signal to before
we do validation of the given TLS certificate. This ensures that we
display certificate information before we possibly error out and
disconnects from the server.
This patch removes support for DANE validation of TLS certificates.
There wasn't enough support in the IRC community to push for this on the
majority of bigger IRC networks. If you believe this should be
reintroduced into irssi, then please come up with an implementation that
does not rely on the libval library. It is causing a lot of troubles for
our downstream maintainers.
This patch adds two new options to /CONNECT and /SERVER to let the user
pin either an x509 certificate and/or the public key of a given server.
It is possible to fetch the certificate outside of Irssi itself to
verify the checksum. To fetch the certificate call:
$ openssl s_client -connect chat.freenode.net:6697 < /dev/null 2>/dev/null | \
openssl x509 > freenode.cert
This will download chat.freenode.net:6697's TLS certificate and put it into the
file freenode.cert.
-tls_pinned_cert
----------------
This option allows you to specify the SHA-256 hash of the x509
certificate. When succesfully connected to the server, irssi will verify
that the given server certificate matches the pin set by the user.
The SHA-256 hash of a given certificate can be verified outside of irssi
using the OpenSSL command line tool:
$ openssl x509 -in freenode.cert -fingerprint -sha256 -noout
-tls_pinned_pubkey
------------------
This option allows you to specify the SHA-256 hash of the subject public key
information section of the server certificate. This section contains both the
cryptographic parameters for the public key, but also information about the
algorithm used together with the public key parameters.
When succesfully connected to the server, irssi will verify that the
given public key matches the pin set by the user.
The SHA-256 hash of a public key can be verified outside of irssi using
the OpenSSL command line tool:
$ openssl x509 -in freenode.cert -pubkey -noout | \
openssl pkey -pubin -outform der | \
openssl dgst -sha256 -c | \
tr a-z A-Z
It is possible to specify both -tls_pinned_cert and -tls_pinned_pubkey
together.
This patch adds the TLS_REC structure. This structure is used to emit
information about the TLS handshake from the core of irssi to the
front-end layers such that we can display connection information to the
user.
This patch changes the internal name of SSL to TLS. We also add -tls_*
options to /CONNECT and /SERVER, but make sure that the -ssl_* versions
of the commands continue to work like before.
This patch removes the optional checks for whether to build irssi with
TLS support or not. This will allow us to ship a default configuration
file where we connect to TLS enabled IRC servers out of the box.
Fixes a problem where the field would end up as a negative number when
exposed to the perl scripts.
And move it near the other bit-packed fields so we take advantage of the
packing.
The IRCv3 SASL extension says that AUTHENTICATION payloads of exactly
400 bytes in length indicate that the message is fragmented and will
continue in a subsequent message. Handle the reassembly and splitting of
these messages so that we are compliant with the specification.
This fixes two issues:
- IRCNet doesn't have STATUSMSG, but it supports +channels, and
including + in the default value meant processing those incorrectly
- The "bahamut hack", for old servers that support but don't advertise
STATUSMSG, didn't work since ischannel_func doesn't use the default.
The choice of @ intentionally leaves out support for other STATUSMSG
(for example, AzzurraNet's bahamut 1.4 fork seemed to support + and % in
any order, contradicting the comment in the code).
I think this is a decent tradeoff, given how those servers are uncommon
and relying on +# or %# is even less common than @#.
Fixes#531
By making the signal handler hooked to the "print starting" event
smarter we can avoid dumping the whole netsplit stats for every
server/channel when a message arrives.
Issue #420
Allow use of /hilight -case exAMPle (compatible with other options)
Added matchcase to hilight config file (exemple: { text = exAMPle; matchcase = yes; } )
That error code means "check errno". A few users got it and we never
figured out what happened - it usually fixed itself after restarting
something - so hopefully with this we'll have more information the next
time.
* Adds two new keys which you can bind in /bind:
yank_next_cutbuffer: Revert to the previous last deleted text
append_next_kill: Append next deletion
* Consecutive kills are now appended to the current cutbuffer
If sasl_timeout is never initialized with a valid timeout id then
calling /disconnect on the server calls g_source_remove() with 0 as tag,
causing an harmless error message to be printed.
Beside that, the sasl_timeout field is defined as a unsigned int.
We can use 0 as sentiel since g_timeout_add returns tags that are always
greater than zero.
If the server didn't send it then just skip the check, the old value it
defaulted to was possibly overlapping with the CHANTYPES leading to an
incorrect behaviour. Fixes#435.
This way net_gethostbyaddr will fail when the system is unable to
resolve the address to a valid host name.
Without this flag in case of failure the function would return the ip
address instead of failing.
/knockout uses /ban to set bans but calls ban_remove() directly to
remove them. This commit makes it use /unban instead. This allows
scripts that hook ban/unban to work automatically with /knockout.
Have a ignore_find_full method that is the one that all the new code
should be using and provide some working stubs for ignore_find and
ignore_find_noact.
This way we prevent the creation of duplicate ignores since the old code
skipped the ignore_find call when a pattern was specified.
It should also cover all the cases where the ignores would be wrongly
overwritten, such as the case outlined in #78.
With bracketed paste, "a\nb" will result in two lines being pasted,
because it's a single thing, with an end marker which the timeout based
pastes don't have.
Due to the way term_gets() counts lines, that input will have
paste_line_count == 1. This can be misleading.
This code adjusts it by looking at the last character, and increasing
the count if it finds anything that isn't a newline.
Issue #340 brought to our attention the fact that under certain
circumstances irssi would go on a wild rampage and carelessly overwrite
some saved channel records in the configuration file.
This happened because the code didn't take into account the case where
the channel index in setupchannels wouldn't match the one in the
configuration; this actually happens when the user removes a chatnet
without removing the associated channels.
Turns out it confuses inspircd, making it reply a NAK with empty
parameter. The rest is ACKed anyway. I've already whined at saberuk
and there's a pending pull request over there fixing this issue.
And, of course, this is cleaner.
This fixes a long-standing bug where 'fname' was being feed to cat
instead of 'real_fname', causing it to quit with a 'No such file or directory'
error.
FS#377
The function "static void paste_buffer_join_lines(GArray *buf)" in
"src/fe-text/gui-readline.c" is supposed to join lines from the GArray
pointed to by *buf under certain circumstances.
In the code of the function "buf" is actually used for getting the length
of the GArray, but to get a pointer to the data, "paste_buffer->data" is
used; paste_buffer is defined in the scope of the whole file.
This delivers the desired result, because this function is only called
once, with "paste_buffer" as the argument. If paste_buffer_join_lines()
will ever be used with a different argument, it will fail.
In m4/curses.m4, line 134, the 5th argument passed to AC_NCURSES was
surrounded by '"' instead of '[' and ']'. Because of that, the expansion
of AC_NCURSES in that case would produce the following line inside the
configure script (note the repeated double quotes):
screen_manager=""ncurses on $withval/include""
That would cause the following error when configure was executed with
the "--with-ncurses=dir" argument:
./configure: line 13468: on: command not found
Although in the case above the error doesn't actually influence the
build process ('screen_manager' isn't used anywhere in the script),
trying to execute 'on' might be harmful if it corresponded to an
existing command in the user's environment.
The symptom for this one is randomly getting lines split before the last
word, even if there's no need for splitting. Also, this function is only
reached if recode is on, and iconv failed (for example, due to an
incorrect source charset). Thanks to vague for finding this and
providing valgrind logs.
The loop that looks for spaces tried to read backwards from the end of
the current line, with the end being determined by len. Assuming
strsplit_len() with len=400, this meant accessing str[399] in the first
iteration. For strings that don't need splitting, this means an invalid
read always.
If that invalid read happens to hit garbage that has a space character,
(len - offset) points after the end of string, which isn't a problem for
g_strndup() since it stops at the first null, and no splitting happens.
If the garbage doesn't have any spaces, it splits by the last word.
This commit avoids that loop entirely if (remaining_len > len). It also
changes the way it iterates over the string to be much less confusing.
Turns out it was fixing the wrong string, and trying to do
atoi("RECON-1") instead of atoi("1").
"/reconnect 1" worked, but "/reconnect RECON-1" gave that confusing
error message.
Given a big enough write_buffer_size and a long enough
write_buffer_timeout it might be possible to show the user an incomplete
or empty awaylog.
Patch by: Petteri Aimonen
term_addstr() had a long-standing fixme that suggested it didn't
take into account the string encoding when calculating the string
length.
The BIG5 code path is untested.
Both cases were off-by-one mistakes erring on the side of being too
conservative. This fixes these two harmless issues:
- For a single empty paste, it required another keystroke before
processing it
- For a sequence of themcase, a single '~' was left in the input
This actually workarounds a bug with the "st" terminal, for which i've
already submitted a patch, but irssi needs to be able to handle it
decently too.
The g_strcmp0 fallback in particular was broken since it was used in a
few places as a GCompareFunc, and macros don't work that way.
Yes, that one was my fault, but nobody complained :D
This drops support for rhel/centos 5 (18 months left of its 10 year
support cycle)
Keeps support for debian 5.0 (lenny) and ubuntu 8.04 LTS, both of
which are unsupported, so bumping up to glib 2.24 wouldn't be a problem,
but it's not needed atm.
Turns out event_names_list() in irc-nicklist.c already handles this.
event_who() just ignores it, which is probably a good idea since some of
the irc servers I tested this with have a bug that results in sending
multiple prefixes in the NAMES reply but not in the WHO one (they were
forks of ircd-hybrid before 7.3.0)
And NAMES always happens, anyway. WHO is omitted sometimes for huge
channels.
The return value is a char*, and here it was false which is 0 which is
more or less the same as null.
That could have been a crash somewhere, the functions that call this
don't expect null ever.
Just passing the full target to the "message irc op_public" signal
handler and letting it do the cleanup.
The fe_channel_skip_prefix() call in event_privmsg() is kept because
recode_in() needs a real channel name, but
There was similar code in sig_message_own_wall(), but that one is
correct - the /wall command always sends NOTICE @#chan, so I added a
comment down there to make it clear.
Fixes FS#817 - "SegFault when executing bind command", which provides
the test case "/bind cleft key meta", which is stupid but now it doesn't
break things.
The limit of 100 is arbitrary, it means roughly 140 stack frames total.
The flyspray ticket mentions it crashes at 512, in my system it goes all
the way to 149677 stack frames.
http://bugs.irssi.org/index.php?do=details&task_id=817
http://bugs.irssi.org/index.php?do=details&task_id=905
Not using the patch from that ticket, the issue turned out to be that
(dest - last_lf_pos) returned number of unichr, not bytes, so that's 4
times less than what the size parameter of memmove() should be.
We disable the ICRNL flag to make Enter independent from ^J from the
keybinding point of view since the former will now send ^M, leaving the
user free to remap ^J without trapping itself into the irssi session
because of a broken Enter key.
Also disable the software flow control because we don't expect anyone to
run irssi over a serial console; we gain some more freedom by having ^Q
and ^S freely mappable by the user.
Replace G_SOURCE_REMOVE with FALSE for the compatibility sake.
Zero the timeout id after g_source_remove and when exipred.
Save the sasl_* options in sig_chatnet_saved().
The only supported methods are PLAIN and EXTERNAL, the latter is untested as of
now.
The code gets the values from the keys named sasl_{mechanism,username,password}
specified for each chatnet.
Enter the "application" mode when setting up the terminal, this improves the
compatiblity with the standards; as a side effect now DEL key works ootb when
irssi is run in the suckless's st terminal.
Clean up the vector resulting from g_strsplit before
returning from expando_hostname(). Also, use g_strdup()
instead of g_strconcat() to return the pointer to hostname.
When changing the value of irssiproxy_ports to use a different network
name in a port that was already bound (so like changing from asd=6667 to
sdf=6667) it would throw "address already in use".
This fixes it by delaying the add_listen() calls after all the
remove_listen() were called.
Updated the bundled scripts to their latest version (#143)
Removed sb_search.pl which is not contributed into the script archive, I
will poke coekie about it.
The function now skips all the leading characters that are in the STATUSMSG. If
the server didn't send the STATUSMSG option then it's assumed to be "@+" for
compatibility with bahamut 2.4 (sic).
Only the filename can come right after `-file`. Having `-force` in that position causes an `Irssi: Could not open lastlog: No such file or directory` error.
I wrote some tests to compare the behavior but I don't know where to put
them, so i'm including them here:
assert(g_strcmp0("a", "b") == -1);
assert(g_strcmp0(NULL, "a") == -1);
assert(g_strcmp0("a", NULL) == 1);
assert(g_strcmp0("b", "a") == 1);
assert(g_strcmp0("a", "a") == 0);
assert(g_strcmp0(NULL, NULL) == 0);
Change "proxy client connected" to "proxy client connecting" to avoid being confused by clients that have connected but not necessarily authenticated. Emit "proxy client connected" once authenticated, keeping the name for backwards compatibility.
We add some additional checks into the config parser's
node_section_index, node_traverse and node_set_str functions. In
particular, we check if the requested node is of scalar or complex type
and whether this matches the value found in the config. If it does not
match, then a warning is issued appropriately and the config is
corrected.
By temporarily raising the fatal log level to critical during irssi
start-up, we make it fail when the config file is broken. This is then
re-set so that /reload of a broken config file will not crash irssi and
just report the errors and gracefully continue instead.
The change introduced in #191 will crash irssi immediately if you
accidentally try to /reload certain broken config files. It is enough to
warn the user in this case, so we turn g_error into g_critical.
this adds the CONFIG_REC * to the config_node_section and
config_node_section_index APIs as they will require access to the config
cache later on to make the config parser more robust.
sed -i 's/hv_store/(void) &/'
This only results in a warning in older gcc versions, but that includes
the one used in the Travis CI environment by default
Fixes issue #187. It's a bit annoying this can't do anything other than
exit, however as there's no schema for the config it's only possible to
validate on use. This level of config can't be accessed from Perl so a
script can't cause Irssi to die (via this method at least).
Before this, doing "TERM=vt100 irssi" showed all text as bold and
blinking because of a failed check of window->term->TI_colors that
was doing (value & 8) and not expecting a value of 0.
The changed lines themselves look a bit weird, but they make more sense
in the context of the original commit, 96a292d4.
Original patch by hondza <sedaj2@gmail.com>, from FS#833. I applied
several needed style changes, and rebased to current HEAD.
This implements the IRCv3.2 self-message extension partially (we can't
announce its support through CAP yet). This is also the format used by
the 'privmsg' znc module, and is already implemented by several other
clients.
At some point in the past few years, Flyspray changed its URL scheme from id=nnn to task_id=nnn, which broke some old comments in the source. Update those comments to URLs that still work.
Try to split long lines on spaces to avoid words being splitted. This
can be turned off with the option `split_line_on_space'. The code
assumes that the terminal encoding has ASCII spaces.
With many ignores (a few thousand) /reload could take so long that connections
were dropped. The problem is that nickmatch_rebuild() was being called for
every ignore. The easy solution is to only call it once at the end.
Fixes FS#721
This makes Ctrl+^ and ^ bindable again as different keys. We do this
by escaping single `^` as `^-`, which is not a valid control character
(unlike `^^`)
The original approach suggested in FS#721 is insufficient, it will
break bindings such as `meta-^` because Irssi is convinced that `^`
introduces a Control-key ("key combo") so it is waiting for what may
follow.
This way lynx also emits URLs for references at the bottom,
like elinks does.
The formating is a little different though (word wrapping),
and elinks adds a "Visible links" line as well.
add the missing alternate_nick in Irc::Server by making an additional
call to the Irc::Connect filler. this is not quite ideal but might
need bigger refactoring otherwise.
2014-06-30 00:57:07 +02:00
587 changed files with 34127 additions and 16214 deletions
<p>Internet Relay Chat was created in 1988 and has hardly changed. It can be used to exchange text messages (one message = single line) with other people, either privately (called query, PM, private message, MSG) or in a room (channel). Pictures are shared by uploading them to a temporary host like <aclass="reference external"href="https://pomf.lain.la/">https://pomf.lain.la/</a> and then pasting the HTTP links. Code snippets or longer texts are shared by pasting them to a Pastebin like <aclass="reference external"href="https://paste.opensuse.org/">https://paste.opensuse.org/</a> and then sharing the HTTP link.</p>
<p>IRC does not have message history. You can only receive replies while your computer is turned on and connected to the channel you want to follow. Some people run their IRC programs on remote servers for that reason.</p>
<p>IRC is organised into networks. Each network consists of many servers. It (mostly) does not matter which server you connect to as long as it belongs to the network you want to use. Irssi supports connections to many networks at the same time.</p>
<p>Each network contains many channels, rooms that are often dedicated to discussing a specific topic. You can find many channels on <aclass="reference external"href="https://netsplit.de/">https://netsplit.de/</a> or using a search engine with the keyword “IRC”. Irssi supports joining many channels at the same time.</p>
<p>There is a rather large IRC network catering to free and open-source software and peer directed projects at <aclass="reference external"href="https://libera.chat/">https://libera.chat/</a> and a smaller one at <aclass="reference external"href="https://www.oftc.net/">https://www.oftc.net/</a>– many free software projects still have support channels on these IRC networks (although some have moved to Matrix or proprietary platforms like Discord).</p>
</section>
<sectionid="first-start">
<h2>First start</h2>
<p>After (compiling and) installing Irssi, to start it, open a shell (Terminal) and type:</p>
<p>You should be greeted by a blinking cursor behind <codeclass="docutils literal notranslate">[(status)]</code>. You are now in the status window of Irssi. Window is the Irssi name for what you might nowadays call a “Web browser tab”.</p>
<p>If you’re confused about what you are seeing on the Irssi screen, you can find an annotated screenshot of it at <aclass="reference internal"href="../User-interface/">User interface</a>.</p>
<p>If you want, you can pick a nick name (handle) that will be shown to others reading your messages now, by typing</p>
<divclass="highlight-default notranslate"><div><pre>/set nick whatyouwant
</pre></div>
</div>
<p>Each command or message can be sent by pressing Enter. Commands in Irssi start with a <codeclass="docutils literal notranslate">/</code>. If there is no <codeclass="docutils literal notranslate">/</code>, then the line that you wrote will be sent as a message to the channel that you have open, for everyone to see.</p>
<sectionid="leaving">
<h3>Leaving</h3>
<p>Type <codeclass="docutils literal notranslate">/quit</code> to get out of Irssi.</p>
</section>
</section>
<sectionid="connecting-to-a-network">
<h2>Connecting to a network</h2>
<p>Irssi comes with some predefined networks. You can see the current list of networks by typing</p>
<p>You should see several messages scroll by. After a while, you should be connected to the Libera Chat network.</p>
<divclass="admonition attention">
<pclass="admonition-title">Attention</p>
<p>Irssi version 1.2 or older may be lacking the liberachat network entry. See <aclass="reference external"href="https://github.com/shabble/irssi-docs/wiki/liberachat">https://github.com/shabble/irssi-docs/wiki/liberachat</a> for how to add it.</p>
</div>
<sectionid="nickname-registration">
<h3>Nickname registration</h3>
<p>Many IRC networks (but not all) offer a way to register a user account. Sometimes (but not on all networks) the account registration also includes reserving a nick for you. <em>How</em> to register also differs by network. Some <em>channels</em> only allow users with registered accounts to join them, so it may be very important for you to register a user account.</p>
<p>User accounts are always specific to a network.</p>
<p>For the Libera Chat network, you can find instructions how to register and set up your account with Irssi on <aclass="reference external"href="https://github.com/shabble/irssi-docs/wiki/liberachat#configure-sasl-automated-log-in">https://github.com/shabble/irssi-docs/wiki/liberachat#configure-sasl-automated-log-in</a></p>
</section>
</section>
<sectionid="joining-a-channel">
<h2>Joining a channel</h2>
<p>Once you are connected to a network, you can join channels by typing <codeclass="docutils literal notranslate">/join #channelname</code>, for example:</p>
<p>Now, a new window will open and you can send messages to the channel.</p>
<sectionid="changing-windows">
<h3>Changing windows</h3>
<p>You can change between windows using the <codeclass="docutils literal notranslate">Ctrl</code>+<codeclass="docutils literal notranslate">n</code> or <codeclass="docutils literal notranslate">Ctrl</code>+<codeclass="docutils literal notranslate">p</code> keys, or–if your terminal is configured properly–using <codeclass="docutils literal notranslate">Alt</code>+<codeclass="docutils literal notranslate">1</code>, <codeclass="docutils literal notranslate">Alt</code>+<codeclass="docutils literal notranslate">2</code>, … See <aclass="reference internal"href="../documentation/help/bind_-list/">bind -list</a> for a list of all default key bindings.</p>
</section>
<sectionid="removing-clutter">
<h3>Removing clutter</h3>
<p>By default, Irssi shows when someone joins or leaves a channel. These messages can waste a lot of lines and obscure the actual chat. To hide them, type</p>
<p>If you want to hide them by default, <codeclass="docutils literal notranslate">/set window_default_hidelevel hidden joins parts quits</code></p>
</section>
</section>
<sectionid="adding-a-new-network">
<h2>Adding a new network</h2>
<p>If you want to join a network that is not there, you first need to find at least one server of that network. Let’s say you have found the room <aclass="reference external"href="https://netsplit.de/channels/details.php?room=%23hackint&net=hackint">#hackint</a> on netsplit.de and want to join it. Then you can find that the <aclass="reference external"href="https://netsplit.de/servers/?net=hackint">server</a> is irc.hackint.org, port 6697, SSL (TLS) on. To add it to Irssi, use the commands:</p>
<p>If you are connected to multiple networks, you can change which one you are “talking” to (which one to send commands) by using the <codeclass="docutils literal notranslate">Ctrl</code>+<codeclass="docutils literal notranslate">x</code> key in the status window.</p>
</section>
</section>
<sectionid="on-line-help">
<h2>On-line help</h2>
<p>Most /commands have a help page, you can read it with</p>
<p>The settings that can be changed with /SET are described on <aclass="reference internal"href="../documentation/settings/">Settings Documentation</a>– the settingshelp <aclass="reference internal"href="#about-scripts">script</a> can be used to read it from within <codeclass="docutils literal notranslate">/help</code></p>
</section>
<sectionid="about-scripts">
<h2>About Scripts</h2>
<p>You can enhance your Irssi by installing scripts. Many Perl scripts written by other Irssi users can be found on <aclass="reference external"href="https://scripts.irssi.org/">https://scripts.irssi.org/</a></p>
<p>Most of them should be compatible with Irssi 1.4 (but some may not, also see the Full Change log for some incompatible ones)</p>
</section>
<sectionid="about-themes">
<h2>About Themes</h2>
<p>Irssi’s look can be thoroughly changed with themes. Many themes created by other Irssi users can be found on <aclass="reference external"href="https://themes.irssi.org/">https://themes.irssi.org/</a></p>
<p>If you want to modify the look of Irssi yourself, the <em>default</em> theme which can be found in your <codeclass="docutils literal notranslate">~/.irssi</code> folder is a good starting point. It also has a few comments explaining what some of the abstracts are used for</p>
<h3id="q-why-doesnt-irssi-display-colors-even-when-ircii-etc-displays-them">Q: Why doesn’t irssi display colors even when ircii etc. displays them?</h3>
<h3>Q: Why doesn't irssi display colors even when ircii etc. displays them?</h3>
<p>A: They force ANSI colors even if terminal doesn’t support them. By default, irssi uses colors only if terminfo/termcap so says. The correct way to fix this would be to change your TERM environment to a value where colors work, like xterm-256color or color_xterm (eg. <code>TERM=xterm-256color irssi</code>). If this doesn’t help, then use the evil way of <code>/SET term_force_colors ON</code>.</p>
<p>A: They force ANSI colors even if terminal doesn't support them. By
default, irssi uses colors only if terminfo/termcap so says. The correct
way to fix this would be to change your TERM environment to a value where
colors work, like xterm-color or color_xterm (eg. <code>TERM=xterm-color
irssi</code>). If this doesn't help, then use the evil way of <code>/SET
term_force_colors ON</code>.</p>
<h3>Q: How do I easily write text to channel that starts with '/' character?</h3>
<h3id="q-how-do-i-easily-write-text-to-channel-that-starts-with--character">Q: How do I easily write text to channel that starts with ‘/’ character?</h3>
<p>A: <code>/ /text</code></p>
<h3id="q-why-doesnt-irssi-update-my-realname-or-whatever-after-i-change-it-with-set-realname-and-reconnect-with-reconnect-or-server">Q: Why doesn’t irssi update my realname (or whatever) after I change it with <code>/SET realname</code> and reconnect with <code>/RECONNECT</code> or <code>/SERVER</code>?</h3>
<h3>Q: Why doesn't irssi update my realname (or whatever) after I change it
with <code>/SET realname</code> and reconnect with <code>/RECONNECT</code>
or <code>/SERVER</code>?</h3>
<p>A: Irssi is trying to be too smart. This will be fixed in future, but for now you should use <code>/DISCONNECT</code> and <code>/CONNECT</code>.</p>
<p>A: Irssi is trying to be too smart. This will be fixed in future, but for
now you should use <code>/DISCONNECT</code> and <code>/CONNECT</code>.</p>
<h3id="q-i-connected-to-some-server-which-isnt-responding-but-now-irssi-tries-to-connect-back-to-it-all-the-time-how-can-i-stop-it">Q: I connected to some server which isn’t responding but now irssi tries to connect back to it all the time! How can I stop it?</h3>
<p>A: Two ways. The “good way” to do it is with <code>/DISCONNECT</code>. Check the server tags first with <code>/SERVER</code> without giving it any parameters, reconnections are those that have tag starting with “recon” text. So most probably you’re going to do <code>/DISCONNECT recon-1</code>. The other way is to remove all the reconnections with <code>/RMRECONNS</code>, easier but may remove some connections you actually wanted to reconnect (if you used multiple servers..).</p>
<h3>Q: I connected to some server which isn't responding but now irssi tries
to connect back to it all the time! How can I stop it?</h3>
<h3id="q-how-do-i-add-seconds-to-timestamp">Q: How do I add seconds to timestamp?</h3>
<p>A: Two ways. The "good way" to do it is with <code>/DISCONNECT</code>.
Check the server tags first with <code>/SERVER</code> without giving it any
parameters, reconnections are those that have tag starting with "recon"
text. So most probably you're going to do <code>/DISCONNECT recon-1</code>.
The other way is to remove all the reconnections with
<code>/RMRECONNS</code>, easier but may remove some connections you actually
wanted to reconnect (if you used multiple servers..).</p>
<p>A: <code>/FORMAT timestamp {timestamp %%H:%%M:%%S}</code> - and remember to add the trailing space :)</p>
<h3id="q-why-does-irssi-say-irssi-channel-not-fully-synchronized-yet-try-again-after-a-while-when-i-try-to-use-ban-etc">Q: Why does irssi say “Irssi: Channel not fully synchronized yet, try again after a while” when I try to use /BAN etc?</h3>
<h3>Q: How do I add seconds to timestamp?</h3>
<p>A: Possibly a bug in irssi, or ircd you’re using does something that irssi didn’t really notice. The new code should make this happen far less often than before, but one known reason for this is when irssi doesn’t notice that you were unable to join some channel. Currently however I don’t know of any such events irssi doesn’t know about.</p>
<p>A: <code>/FORMAT timestamp {timestamp %%H:%%M:%%S}</code> - and remember
to add the trailing space :)</p>
<h3>Q: Why does irssi say "Irssi: Channel not fully synchronized yet, try
again after a while" when I try to use /BAN etc?</h3>
<p>A: Possibly a bug in irssi, or ircd you're using does something that
irssi didn't really notice. The new code should make this happen far less
often than before, but one known reason for this is when irssi doesn't
notice that you were unable to join some channel. Currently however I don't
know of any such events irssi doesn't know about.</p>
<p>Anyway, if this does happen, do <code>/RAWLOG SAVE ~/rawlog</code> soon
after joining to channel, and either try to figure out yourself why irssi
didn't get reply to WHO request, or send the whole log to cras@irssi.org. Note
that the rawlog is by default only 200 lines and it may not be enough to
show all needed information, so you might want to do <code>/SET rawlog_lines
1000</code> or so.</p>
<p>Anyway, if this does happen, do <code>/RAWLOG SAVE ~/rawlog</code> soon after joining to channel, and either try to figure out yourself why irssi didn’t get reply to WHO request, or open a Github issue with the full log included. Note that the rawlog is by default only 200 lines and it may not be enough to show all needed information, so you might want to do <code>/SET rawlog_lines 1000</code> or so.</p>
<p><code>MODE +b</code> still works fine though.</p>
<h3id="q-wheres-the-gui-version">Q: Where’s the GUI version?</h3>
<h3>Q: Where's the GUI version?</h3>
<p>A: There was one on <ahref="https://github.com/irssi-import/xirssi">irssi-import/xirssi</a> but it has not been maintained for a long time.</p>
<h3id="q-how-do-i-autorejoin-channels-after-being-kicked">Q: How do I autorejoin channels after being kicked?</h3>
<p>A: That’s evil and you shouldn’t do it. If you get kicked, you should stay out, at least until the channel forgot you existed :) Most channels I’ve joined just ban you if you autorejoin after kick. If you’re joined to channels who kick people for fun, try changing channels or something.</p>
<h3>Q: How do I autorejoin channels after being kicked?</h3>
<p>Anyway, if you REALLY want to do that, and you understand that you’re doing evilness, you can use the autorejoin.pl script that comes with irssi. You’ll still need to specify the channels you wish to rejoin with <code>/SET autorejoin_channels #chan1 #chan2 ...</code></p>
<p>A: That's evil and you shouldn't do it. If you get kicked, you should stay
out, at least until the channel forgot you existed :) Most channels I've
joined just ban you if you autorejoin after kick. If you're joined to
channels who kick people for fun, try changing channels or something.</p>
<h3id="q-how-do-i-announce-that-im-awayback-in-all-channels-ive-joined-or-how-do-i-change-my-nick-when-setting-myself-awayback">Q: How do I announce that I’m away/back in all channels I’ve joined? Or how do I change my nick when setting myself away/back?</h3>
<p>Anyway, if you REALLY want to do that, and you understand that you're doing
evilness, you can use the autorejoin.pl script that comes with irssi. You'll
still need to specify the channels you wish to rejoin with <code>/SET
autorejoin_channels #chan1 #chan2 ...</code></p>
<p>A: That’s even worse than autorejoin. Who could possibly care every time you come and go? Many channels will kick you for using this, and I for example have added several ignores so I’d never need to see these messages. Learn to use <code>/AWAY</code> command properly and tell its existence to people who don’t know about it. <code>/WII yournick</code> shows your away reason much better for people who actually want to know if you’re there or not.</p>
<h3id="q-why-does-irssi-autojoin-on-invite-by-default">Q: Why does irssi autojoin on invite by default?</h3>
<h3>Q: How do I announce that I'm away/back in all channels I've joined? Or
how do I change my nick when setting myself away/back?</h3>
<p>A: The setting is /SET join_auto_chans_on_invite - it’s not the same as regular autojoin-on-invite, which irssi doesn’t even have. The only channels that are joined on invite, are the ones you’ve added to config with /CHANNEL ADD -auto. This is very useful with +i channels when you need to first send an invite request to bot, or if you get accidentally kicked from channel, the kicker can invite you back immediately.</p>
<p>A: That's even worse than autorejoin. Who could possibly care every time
you come and go? Many channels will kick you for using this, and I for example
have added several ignores so I'd never need to see these messages. Learn to
use <code>/AWAY</code> command properly and tell its existence to people
who don't know about it. <code>/WII yournick</code> shows your away reason
much better for people who actually want to know if you're there or not.</p>
<p>I don’t see any bad side effects with this feature, so it’s ON by default. I guess someone could start kicking/inviting you all the time but server connection shouldn’t drop because of that, and you shouldn’t join channels whose operators are that evil.</p>
<h3id="q-how-to-make-utf-8-support-work-with-irssi">Q: How to make UTF-8 support work with irssi?</h3>
<h3>Q: Why does irssi autojoin on invite by default?</h3>
<p>A: Make sure your terminal supports UTF-8 (for example, <code>xterm -u8</code>). If you use screen, you may have to do <code>screen -U</code>. And in Irssi do <code>/SET term_charset utf-8</code>. (for 0.8.9 and older: <code>/SET term_type utf-8</code>)</p>
<p>A: The setting is /SET join_auto_chans_on_invite - it's not the same
as regular autojoin-on-invite, which irssi doesn't even have. The only
channels that are joined on invite, are the ones you've added to config
with /CHANNEL ADD -auto. This is very useful with +i channels when you
need to first send an invite request to bot, or if you get accidentally
kicked from channel, the kicker can invite you back immediately.</p>
<h3id="q-will-there-be-detach-like-feature">Q: Will there be /DETACH-like feature?</h3>
<p>I don't see any bad side effects with this feature, so it's ON by
default. I guess someone could start kicking/inviting you all the time
but server connection shouldn't drop because of that, and you shouldn't
join channels whose operators are that evil.</p>
<p>A: <ahref="https://tmux.github.io/">tmux</a>, <ahref="https://www.gnu.org/software/screen/screen.html">screen</a> and <ahref="https://sourceforge.net/projects/dtach/">dtach</a> can be used to do it just fine.</p>
<h3id="q-how-do-i-run-scripts-automatically-at-startup">Q: How do I run scripts automatically at startup?</h3>
<h3>Q: How to make UTF-8 support work with irssi?</h3>
<p>A: Put them into <code>~/.irssi/scripts/autorun/</code> directory. Or better would be if you placed them in <code>~/.irssi/scripts/</code> and created symlinks to autorun directory (eg. <code>cd ~/.irssi/scripts/autorun/ ; ln -s ../script.pl .</code>)</p>
<p>A: Make sure your terminal supports UTF-8 (for example, <code>xterm -u8</code>).
If you use screen, you may have to do <code>screen -U</code>. And in Irssi do
<code>/SET term_charset utf-8</code>. (for 0.8.9 and older: <code>/SET term_type utf-8</code>)</p>
<h3id="q-how-do-i-execute-commands-automatically-at-startup">Q: How do I execute commands automatically at startup?</h3>
<p>A: Put them into <code>~/.irssi/startup</code> file, each command on its own line. The preceding slash (/) is not necessary.</p>
<h3>Q: Will there be /DETACH-like feature?</h3>
<h3id="q-how-do-i-easily-edit-existing-topic">Q: How do I easily edit existing topic?</h3>
<p>A: Maybe. Detach code already is there, attach is just missing :) But I
don't have much interest in coding it,
<ahref="http://www.gnu.org/software/screen/screen.html">screen</a> and
<ahref="http://dtach.sf.net/">dtach</a> can be used to do it just fine.</p>
<p>A: <code>/TOPIC <tab></code></p>
<h3id="q-how-can-i-have-whois-replies-to-active-window">Q: How can I have /WHOIS replies to active window?</h3>
<h3>Q: How do I run scripts automatically at startup?</h3>
<p>A: You can disable the status window, or do <code>/WINDOW LEVEL -CRAP</code> in it which would also make several other messages show up in active window. You can also use a <ahref="https://dgl.cx/irssi/hack-whois-in-current-window.pl">script</a>.</p>
<p>A: Put them into <code>~/.irssi/scripts/autorun/</code> directory. Or
better would be if you placed them in <code>~/.irssi/scripts/</code> and
created symlinks to autorun directory (eg. <code>cd
GOTO: Go to the window with the given nickname, channel or number.
NEXT: Go to the next window.
LAST: Go to the last window.
PREVIOUS: Go to the previous window.
LEVEL: Modifies the text levels to display in the window.
IMMORTAL: Modifies the window mortality status.
SERVER: Set the active server of the window.
ITEM PREV: Go to the previous item in the window.
ITEM NEXT: Go to the next item in the window.
ITEM GOTO: Go to the specified nickname, channel or window item number.
ITEM MOVE: Move the active window item to another window.
NUMBER: Move the active window to another position.
NAME: Give the window a name.
HISTORY: Clears the window history buffer.
MOVE PREV: Move the window down.
MOVE NEXT: Move the window up.
MOVE FIRST: Move the window to the first position.
MOVE LAST: Move the window to the last position.
MOVE: Move the window.
LIST: List all the windows.
THEME: Applies a theme to the windows.
GROW: Increase the window size when using split windows.
SHRINK: Decrease the window size when using split windows.
SIZE: Modify the window size when using split windows.
BALANCE: Balance the window locations when using split windows.
HIDE: Hide the window when using split windows.
SHOW: Show the window when using split windows.
UP: Go to the window above when using split windows.
DOWN: Go to the window below when using split windows.
LEFT: Go to the previous window.
RIGHT: Go to the next window.
STICK: Make the window sticky.
MOVE LEFT: Move the window to the previous location.
MOVE RIGHT: Move the window to the next location.
MOVE UP: Move the window up when using split windows.
MOVE DOWN: Move the window down when using split windows.
LOG: %|Turn on or off logging of the active window, optionally specifying the log file to use.
LOGFILE: %|Sets the location of the log file to use for window logging without starting to log.
NEW: %|Creates a new hidden or split window.
CLOSE: %|Closes the current window, the specified one or all windows in the given range.
REFNUM: %|Go to the window with the given number.
GOTO: %|Go to the window with activity, with the given nickname, channel or with the specified number.
NEXT: %|Go to the next window numerically.
LAST: %|Go to the previously active window.
PREVIOUS: %|Go to the previous window numerically.
LEVEL: %|Changes the text levels to display in the window, or query the current level.
IMMORTAL: %|Modifies or queries the window mortality status. Immortal windows have an extra protection against WINDOW CLOSE.
SERVER: %|Change the active server of the window or the server stickyness. If the server is sticky, it cannot be cycled with next_window_item/previous_window_item
ITEM PREV: %|Make the previous item in this window active.
ITEM NEXT: %|Make the next item in this window active.
ITEM GOTO: %|Change to the query with the specified nickname, channel with the given name or window item number.
ITEM MOVE: %|Move the active window item to another window, or move the channel or query item specified by their name to the current window.
NUMBER: %|Change the active window number to the specified number, swapping the window already in that place if required. With -sticky, protect the window number from renumbering done by windows_auto_renumber. (To re-set the sticky attribute, use WINDOW NUMBER again without -sticky.)
NAME: %|Change or clear the window name. Window names must be unique.
HISTORY: %|Set or clear a specific named history to use for this window. All windows with the same named history will share a history.
MOVE PREV: %|Move the window to the place of the numerically previous window. At the first position, move the window to the end and renumber the consecutive block that it was part of.
MOVE NEXT: %|Move the window to the place of the numerically next window. At the last position, move the window to the first position and renumber the consecutive block at first position (if any)
MOVE FIRST: %|Move the window to the first position. Any windows inbetween are moved to their numerically next positions.
MOVE LAST: %|Move the window to the last position. Any windows inbetween are moved to their numerically previous positions.
MOVE: %|Move the window to the specified number or the first number that is in use when moving the window in the direction of the specified position. Any windows inbetween are shifted towards the old position of the window (unused positions remain empty)
LIST: %|List all the windows.
THEME: %|Applies or removes a per-window theme.
GROW: %|Increase the size of the active split window by the specified number of lines.
SHRINK: %|Decrease the size of the active split window by the specified number of lines.
SIZE: %|Set the current split window size to the specified number of lines.
BALANCE: %|Balance the heights of all split windows.
HIDE: %|Hides the current split window, or the split window specified by number or item name.
SHOW: %|Show the window specified by number or item name as a new split windows. It is made sticky when autostick_split_windows is turned on.
UP: %|Set the split window left or above the current one active. At the top, wraps to the bottom.
DOWN: %|Set the split window right or below the current one active. At the bottom, wraps left.
LEFT: %|Go to the previous window numerically that is part of the current sticky group (or not part of any sticky group).
RIGHT: %|Go to the next window numerically that is part of the current sticky group (or not part of any sticky group).
STICK: %|Make the currently active window sticky, or stick the window specified by number to the currently visible split window. Or turn off stickyness of the currently active window or the window specified by number.
HIDELEVEL: %|Changes the levels of text lines that should be hidden from view, or query the current hidden level.
MOVE LEFT: %|Move the window to the numerically previous location inside the current sticky group.
MOVE RIGHT: %|Move the window to the numerically next location inside the current sticky group.
MOVE UP: %|Move the current window to the sticky group of the previous split window. If no sticky group remains, the split window collapses.
MOVE DOWN: %|Move the current window to the sticky group of the next split window. If no sticky group remains, the split window collapses.
Add the required arguments for the given command.
-right: %|Makes the command work on the width instead of height, or create the split window to the right instead of top.
-directional: %|Set the split window in the given direction to the current one active, or move the current window to the sticky group of the split window in the given direction. (If no sticky group remains, the split window collapses.)
%|Add the required arguments for the given command. Without arguments, the details (size, immortality, levels, server, name and sticky group) of the currently active window are displayed. If used with a number as argument, same as WINDOW REFNUM.
%|LEVEL and HIDELEVEL modify the currently set level. Without arguments, the current level is displayed. Levels listed starting with `+' are added to the current levels. Levels listed starting with `-' are removed from the current levels. To clear the levels, start the new level setting with `NONE'. Levels listed starting with `^' are either removed or added from the current setting, depending on whether they were previously set or not (since Irssi 1.4.4). Levels listed as is are also added to the current levels. Afterwards, the new level setting is displayed.
%9Description:%9
@ -65,7 +71,8 @@
/WINDOW LOG OFF
/WINDOW LOG ON ~/logs/debug.log
/WINDOW LEVEL -ALL +NOTICES
/WINDOW HIDELEVEL ^JOINS ^PARTS ^QUITS
/WINDOW LOGFILE ~/logs/notices.log
%9See also:%9 JOIN, LEVELS, LOG, QUERY
%9See also:%9 JOIN, LEVELS, LOG, QUERY, SET window_default_level, SET window_default_hidelevel
<p>To create a “tabular” effect of the chat view, or to align nick names in a column, you can use Irssi’s theme/format system. The basic commands are the following:</p>
<p>These are copied from the default theme’s default values, which are responsible for displaying your own messages sent to a channel (<codeclass="docutils literal notranslate">own_msg</code>) as well as received messages (<codeclass="docutils literal notranslate">pubmsg</code>) and the two basic highlightings (<codeclass="docutils literal notranslate">me</code> and <codeclass="docutils literal notranslate">hilight</code>).</p>
<p>Then, in front of the argument that contains the nick name (<codeclass="docutils literal notranslate">$0</code> in most cases, but <codeclass="docutils literal notranslate">$1</code> in <codeclass="docutils literal notranslate">pubmsg_hilight</code>), an alignment modifier (see <aclass="reference internal"href="../../settings/#a-b">Appendix B: Special Variables and Expandos</a>) has been added: <codeclass="docutils literal notranslate">[-9]</code>. This means that the nicks will be right-aligned and truncated to 9 characters.</p>
<p><strong>Note</strong>: Modifiers <em>only</em> work in the <codeclass="docutils literal notranslate">/format</code> section of a theme (this may change in the future)</p>
<p>There are also some scripts that try to do the alignment for you, like: <codeclass="docutils literal notranslate">nm</code>, <codeclass="docutils literal notranslate">nm2</code>.</p>
<p>There are also some nice themes that extend the alignment to further formats, like: <aclass="reference external"href="https://github.com/ronilaukkarinen/weed">weed</a>.</p>
<h1>Automatic log-in to NickServ</h1>
<p>Please check here =><aclass="reference internal"href="../../manual/automation/#automatic-log-in-to-nickserv">Automatic log-in to NickServ</a></p>
<h1>CertFP Log-in</h1>
<p>CertFP, short for Certificate Finger Print, is another method to log you in to NickServ. Instead of a password, it uses a <aclass="reference external"href="https://en.wikipedia.org/wiki/Client_certificate">Client Certificate</a>.</p>
<p>In order to use it, you</p>
<ulclass="simple">
<li><p>first need a certificate,</p></li>
<li><p>then configure Irssi to use this certificate,</p></li>
<li><p>and finally register the certificate with NickServ.</p></li>
</ul>
<p>Irssi does not have built-in certificate management commands, so you need to use an external tool like <codeclass="docutils literal notranslate">openssl</code> to create the certificate.</p>
<p>A step-by-step guide for the Libera Chat network can be found here =><aclass="reference external"href="https://github.com/shabble/irssi-docs/wiki/liberachat_certfp">https://github.com/shabble/irssi-docs/wiki/liberachat_certfp</a></p>
<p>It is necessary that the certificate be available as a file; PKCS#11 is not supported.</p>
<h1>Tor (The Onion Router)</h1>
<p><aclass="reference external"href="https://www.torproject.org/">Tor</a> is an overlay network for anonymous communication. It operates a local <aclass="reference external"href="https://en.wikipedia.org/wiki/SOCKS">SOCKS</a> proxy for applications to use.</p>
<p>Unfortunately, Irssi currently does not support SOCKS proxies natively. As a workaround, you can install the <aclass="reference external"href="https://github.com/rofl0r/proxychains-ng">ProxyChains-NG</a> program (note, it must be the NG version).</p>
<p>Afterwards, you can launch Irssi like this:</p>
<p>Now your connections will go through the Proxy configured in ProxyChains-NG (Tor by default).</p>
<p>IRC networks may have different requirements to be able to connect via Tor. For the Libera Chat network, you will first need to set up <aclass="reference internal"href="../certfp/">CertFP Log-in</a> using a clearnet connection, and then connect to their <aclass="reference external"href="https://libera.chat/guides/connect#accessing-liberachat-via-tor">Onion Service</a><codeclass="docutils literal notranslate">palladium.libera.chat</code>. More detailed instructions can be found here =><aclass="reference external"href="https://github.com/shabble/irssi-docs/wiki/liberator">https://github.com/shabble/irssi-docs/wiki/liberator</a></p>
<h1>The following signatures were invalid: EXPKEYSIG</h1>
The following signatures were invalid: EXPKEYSIG EDB7AED941EEDB57 home:ailin_nemui OBS Project <home:ailin_nemui@build.opensuse.org>
</pre></div>
</div>
<p>this means that the automatic signing key used by the Open Build Service expired. OBS renews the key periodically, but Debian does not support this.</p>
<sectionid="fix">
<h2>Fix</h2>
<p>Download the key again, following the regular OBS instructions. If it still does not work, verify if there is a second expired copy of the key in <codeclass="docutils literal notranslate">/etc/apt/trusted.gpg.d</code> or in <codeclass="docutils literal notranslate">apt-key list</code> and remove it as well.</p>
<h3><aid="c2">2. Основы пользовательского интерфейса</a></h3>
<p>Для скроллинга содержимого окон используйте PgUp и PgDown. Если они не работают, используйте кнопки Meta-p и Meta-n.
Чтобы перескочить в начало или конец буфера используйте команды <code>/SB HOME</code> и <code>/SB END</code>.</p>
<p>По умолчанию irssi использует для всего "скрытые окна". Скрытое окно создается каждый раз когда вы заходите(<code>/JOIN</code>) на канал или создаете приват(<code>/QUERY</code>)
с кем-то. Есть несколько способов переключения между этими окнами:</p>
<pre>
Meta-1, Meta-2, .. Meta-0 - Переключение между окнами 1-10
Meta-q .. Meta-o - Переключение между окнами 11-19
/WINDOW <номер> - Переключение на окно с заданным номером
Ctrl-P, Ctrl-N - Переключение к предыдущему/следующему окну
</pre>
<p>Простейший способ переключения - это Meta-номер. Что такое Meta?
Для некоторых терминалов это ALT. Если у вас windows-совместимая клавиатура, то это так-же может быть левая кнопка windows. Если они не работают, то вам придется настроить некоторые X-ресурсы
(это работает как в xterm так и в rxvt):</p>
<pre>
XTerm*eightBitInput: false
XTerm*metaSendsEscape: true
</pre>
<p>В rxvt вы так-же можете указать какая кнопка соответствует кнопке meta, так что если вы хотите использовать Alt вместо Win допишите это в файл с ресурсами:</p>
<pre>
rxvt*modifier: alt
</pre>
<p>Вы так-же можете сделать это при помощи xmodmap:</p>
<pre>
xmodmap -e "keysym Alt_L = Meta_L Alt_L"
</pre>
<p>Так как-же установить эти X-ресурсы? Для Debian'а, это файл
<code>/etc/X11/Xresources/xterm</code>, в который вы можете их засунуть и они будут автоматически читаться при старте иксов. Файлы <code>~/.Xresources</code> и
<code>~/.Xdefaults</code> так-же должны работать. Если ничего из вышеперечисленного не работает, то просто скопируйте их в <code>~/.Xresources</code>
и загрузите командой <code>xrdb -merge ~/.Xresources</code>.
Изменения начинают действовать только в заново запущенном терминале.</p>
<p>Многие SSH клиенты под Windows так же не разрешают использовать кнопку ALT. Прекрасный клиент, который позволяет делать это - putty, вы можете скачать егос
<p>Так-же поддерживает разделение окон. Вот команды, которые позволяют это сделать:</p>
<pre>
/WINDOW NEW - Создать новое разделенное окно
/WINDOW NEW HIDE - Создать новое скрытое окно
/WINDOW CLOSE - Закрыть разделенное или скрытое окно
/WINDOW HIDE [<number>|<name>] - Сделать разделенное окно скрытым
/WINDOW SHOW <number>|<name> - Сделать скрытое окно разделенным
/WINDOW SHRINK [<lines>] - Уменьшить активное окно
/WINDOW GROW [<lines>] - Увеличить активное окно
/WINDOW BALANCE - Сбалансировать размеры всех разделенных окон
</pre>
<p>По умолчанию Irssi использует "приклеивание окон". Это подразумевает, что окно, созданное внутри разделенного окна не может быть перемещено без некоторого гемора :). Например у вас может быть следующее расположение окон:</p>
<p>Когда вы в окне win#1 нажимаете ALT-6, irssi переключается на разделенное окно
#3 и перемещает канал efnet/#channel2 в активное окно.</p>
<p>При "незакреплённом" варианте окна не имеют никакой связи с разделенными окнами
и нажатие ALT-6 в окне win#1 перемещает окно win#6 в разделенное окно 1
и делает его активным, исключение может быть когда окно win#6 уже видимо в каком-то другом
разделенном окне, irssi просто переключается к этому разделенному окну. Такой метод переключения между окнами применяется в ircII и если он вам понравился то вы можете активизировать его при помощи команды</p>
<pre>
/SET autostick_split_windows OFF
</pre>
<p>Каждое окно внутри себя может содержать много каналов, приватов и других "вещей". Если вы вообще не любите окна, то вы можете отменить их командой</p>
<pre>
/SET autocreate_windows OFF [format c: надёжнее ;) - прим. перев.]
</pre>
<p>И если вы держите все каналы в одном окне, то вам наверное захочется чтобы имя канала выводилось в каждом сообщении:</p>
<pre>
/SET print_active_channel ON
</pre>
<p>Если вы хотите сгруппировать в какое-то окно только некоторые каналы или приваты, то используйте эти команды:</p>
<pre>
/JOIN -window #channel
/QUERY -window nick
</pre>
<h3><aid="c3">3. Автозаход на каналы и серверы</a></h3>
<p>В Irssi многосерверная поддержка ИМХО очень хорошая :). Даже если вы хотите общаться только в одной сети, то очень удобно сгруппировать все серверы этой сети в одну группу т.к. это помогает в случае невозможности соединения с главным сервером и в некоторых других случаях :).
Дополнительную информацию об эффективном использовании многосерверной поддержки смотрите в главе 6.</p>
<p>Для начала вам нужно установить свою IRC-сеть, для этого используйте команду <code>/IRCNET</code>,
чтобы убедится, что она ещё не установлена. Если она не установлена, то введите <code>/IRCNET ADD
имя_сети</code>. Если вы хотите, чтобы какие-то команды автоматически выполнялись при подключении к этой сети, то воспользуйтесь опцией <code>-autosendcmd</code>.
<p>Опция <code>-auto</code> указывает, что к этому серверу нужно автоматически подключаться при запуске.
Вы не должны помечать другие серверы той-же сети опцией <code>-auto</code> - Irssi автоматически к ним подключится, если сервер помеченный <code>-auto</code> недоступен.</p>
<p>Опции <code>-bots</code> и <code>-botcmd</code> требуют небольшого пояснения.
Они используются для того, чтобы автоматически давать команды боту при заходе на канал,
обычно для автоматического получения опа. Вы можете задать много масок ботов при помощи опции
<code>-bots</code>, разделенной пробелами (не забудьте взять эту строку в кавычек). Переменная $0 в опции
<code>-botcmd</code> указывает на первого бота в списке найденных. Если вы не хотите использовать маски для ботов (например если бот всегда сидит под одним ником)
вы можете указать только опцию <code>-botcmd</code> и команду.</p>
<h3><aid="c4">4. Настройка окон и автоматическое восстановление при запуске</a></h3>
<p>Для начала создайте нужные окна(подключитесь к нужным серверам, каналам и.т.д.).
Для перемещения окон используйте следующие команды:</p>
<pre>
/WINDOW MOVE LEFT/RIGHT/номер - переместить окно влево, вправо или на указанный номер
/WINDOW ITEM MOVE <номер>|<имя> - переместить канал или приват в другое окно
</pre>
<p>Когда всё выглядит так, как вы хотите, используйте команду <code>/LAYOUT SAVE</code>
(и <code>/SAVE</code>, если не включено автосохранение) и когда вы в следующий раз запустите irssi, то он вспомнит позиции сохраненных окон.
Это "запоминание" не означает, что использование команды <code>/LAYOUT SAVE</code> будет приводить к автоматическому подключению к серверам и заходу на каналы,
для этого вы должны использовать команды <code>/SERVER ADD -auto</code> и <code>/CHANNEL ADD -auto</code>.</p>
<p>Чтобы изменить сохраненные настройки окон, расставьте их в нужные позиции и заново введите команду <code>/LAYOUT SAVE</code>.
Чтобы обнулить настройки используйте команду <code>/LAYOUT RESET.</code></p>
<h3><aid="c5">5. Окна status и msgs & уровни сообщений</a></h3>
<p>По умолчанию "дополнительные сообщения" выводятся в окно статуса. Под дополнительными подразумеваются сообщения, которые не принадлежат ни к одному каналу или привату(например ctcp-запросы).
Некоторых людей они раздражают, так что если вы хотите их скрыть, то введите</p>
<pre>
/SET use_status_window OFF
</pre>
<p>Этот параметр заработает только после перезапуска irssi. Если вы хотите удалить их немедленно, то просто закройте окно(<code>/WINDOW CLOSE</code>).</p>
<p>Другое основное окно - это "окно сообщений", куда идут все сообщения привата.
По умолчанию оно отключено и вместо этого для каждого привата создается новое окно. Чтобы все сообщения привата шли в одно окно используйте команду:</p>
<pre>
/SET use_msgs_window ON
/SET autocreate_query_level DCCMSGS (или если вы так-же не хотите
создавать новые окна для DCC-чата напишите NONE)
</pre>
<p>Этот параметр так-же не будет задействован до перезапуска irssi. Чтобы применить его немедленно введите:</p>
<pre>
/WINDOW NEW HIDE - создать окно
/WINDOW NAME (msgs) - переименовать его в "(msgs)"
/WINDOW LEVEL MSGS - перенаправить все приватные сообщения в это окно
/WINDOW MOVE 1 - сделать это окно первым в списке
</pre>
<p>Учтите, что ни use_msgs_window, ни use_status_window не будут работать если использована команда <code>/LAYOUT SAVE</code>.</p>
<p>Теперь мы подошли к уровням сообщений.. Что это? Все сообщения, которые выводит irssi имеют один или больше
"уровень сообщений". Вот основные уровни: PUBLIC - для сообщений на каналах,
MSGS - для приватных сообщений и CRAP для остальных сообщений, которые нельзя классифицировать. Вы можете получить полный список уровней при помощи команды</p>
<pre>
/HELP levels
</pre>
<p>Окну статуса присвоен уровень <code>ALL -MSGS</code>, который подразумевает, что все сообщения,
исключая приватные, для которых не назначено другое место идут в это окно. Благодаря опции <code>-MSGS</code> оно не конфликтует с окном сообщений.</p>
<h3><aid="c6">6. Как в irssi работает многосерверная поддержка</a></h3>
<p>В ircII и некоторых других IRC-клиентах многосерверная поддержка реализована в виде помещения вкладки с сервером в список окон
. В IRSSI НЕТ. Нет никакой связи между окном и сервером. Вы можете подключиться к десяти серверам одновременно и управлять ими всеми из одного окна, или заходить на каналы на каждом из них
в одном окне, если вы действительно этого хотите. Как было сказано вы можете подключиться к новому серверу, не закрывая текущего соединения:</p>
<pre>
/CONNECT irc.server.org
</pre>
<p>Вместо команды <code>/SERVER</code>, которая закрывает существующее
соединение. Чтобы посмотреть список осуществленных соединений используйте команду <code>/SERVER</code>
без параметров. Вы увидите примерно следующее:</p>
<pre>
-!- IRCNet: irc.song.fi:6667 (IRCNet)
-!- OFTC: irc.oftc.net:6667 (OFTC)
-!- RECON-1: 192.168.0.1:6667 () (02:59 left before reconnecting)
</pre>
<p>Здесь видно, что мы подключены к сетям IRCNet и OFTC.
Надпись IRCNet в начале является "меткой сервера" а
(IRCnet) в конце показывает соответствующую IRC-сеть. Метка сервера соответствует уникальному имени, которое обычно совпадает с названием сети.
Когда IRC-сеть не известна это какая-то часть имени сервера.
Когда осуществлены несколько соединений с одной сетью или сервером, irssi
добавляет цифру после метки, так что это может быть ircnet, ircnet2, ircnet3
В вышеприведенном примере мы видим, что подключение к серверу 192.168.0.1 было неудачным и
irssi попробует подключиться заново через 3 минуты.</p>
<p>Чтобы отключиться от сервера используйте следующие команды:</p>
<pre>
/DISCONNECT ircnet - отключиться от сервера с меткой "ircnet"
/DISCONNECT recon-1 - остановить попытки переподключения к серверу RECON-1
/RMRECONNS - остановить все попытки переподключения
/RECONNECT recon-1 - немедленно попробовать переподключиться к RECON-1
/RECONNECT ALL - немедленно попробовать переподключиться ко всем серверам
в очереди на подключение
</pre>
<p>Теперь, когда вы подключены ко всем серверам вы должны знать как указать какой из них вы хотите использовать.
Единственный способ - это иметь пустое окно наподобе окна статуса. В нем вы можете выбрать какой сервер хотите сделать активным</p>
<pre>
/WINDOW SERVER tag - сделать сервер с меткой "tag" активным
Ctrl-X - Сделать следующий в списке сервер активным
</pre>
<p>Когда сервер активный вы можете нормально его использовать. Когда вы подключены к нескольким серверам, irssi добавляет префикс [метка_сервера]
ко всем сообщениям, не относящимся к каналу или привату так что вы можете знать с какого сервера оно пришло.</p>
<p>Некоторые команды так-же позволяют использовать опцию <code>-метка_сервера</code>
чтобы указать для какого сервера вы хотите её использовать:</p>
<pre>
/MSG -метка ник сообщение
/JOIN -метка #канал
/QUERY -метка ник
</pre>
<p>Автодополнение команды <code>/MSG</code> так-же автоматически добавляет метку сервера
когда ник не на активном сервере.</p>
<p>Окно сервера можно сделать закреплённым. Когда оно закреплено, то оно никогда автоматически не переключится на какое-то другое, и если произошло отключение от сервера,
то оно не будет иметь активного сервера. Когда к серверу снова произведено подключение,
то он автоматически становится активным в этом окне. Чтобы закрепить окно сервера используйте следующую команду:</p>
<pre>
/WINDOW SERVER -sticky tag
</pre>
<p>Это полезно если вы хотите иметь отдельные окна статуса и сообщений для каждого сервера. Вот как это можно сделать (повторите для каждого сервера):</p>
<pre>
/WINDOW NEW HIDE
/WINDOW NAME (status)
/WINDOW LEVEL ALL -MSGS
/WINDOW SERVER -sticky ircnet
/WINDOW NEW HIDE
/WINDOW NAME (msgs)
/WINDOW LEVEL MSGS
/WINDOW SERVER -sticky ircnet
</pre>
<h3><aid="c7">7. Команда /LASTLOG и прокрутка окон</a></h3>
<p>Команда <code>/LASTLOG</code> может быть использована для поиска текста в буфере окна. Вот простейшие примеры её использования:</p>
<pre>
/LASTLOG слово - вывести все строки, содержащие "слово"
/LASTLOG word 10 - вывести последние 10 строк, содержащих "word"
/LASTLOG -topics - вывести все изменения топика
</pre>
<p>Если результатом вывода должны стать более 1000 строк, то irssi предположит, что вы допустили ошибку и выведет их только с опцией <code>-force</code>.
Чтобы сохранить содержимое буфера окна в файл, используйте следующую команду:</p>
<pre>
/LASTLOG -file ~/irc.log
</pre>
<p>При использовании опции <code>-file</code> опция <code>-force</code>
не требуется. У команды <code>/LASTLOG</code> есть много других опций. Чтобы получить более подробную справку по ней используйте <code>/HELP lastlog</code>.</p>
<p>Когда вы нашли интересовавшие вас строки, вам скорее всего захочется посмотреть другие прилегающие к ним сообщения. В Irssi есть команда <code>/SCROLLBACK</code> (или
её синоним - <code>/SB</code>) для перемещения по буферу окна.
Команда <code>/LASTLOG</code> выводит оригинальное время сообщения
и вы можете использовать команду <code>/SB GOTO чч:мм</code> чтобы "перепрыгнуть" к этому фрагменту дискуссии.
Чтобы переместиться обратно вниз используйте команду <code>/SB
END</code>.</p>
<h3><aid="c8">8. Ведение логов</a></h3>
<p>Irssi может автоматически вести лог всех важных сообщений когда вы в эвее
(<code>/AWAY причина</code>). когда вы вышли из эвея
(ещё раз введите <code>/AWAY</code>), новые сообщения в эвей-логе выводятся на экран.
Вы можете настроить его при помощи следующих команд:</p>
<pre>
/SET awaylog_level MSGS HILIGHT - Выбирает какое сообщения надо записывать в лог
/SET awaylog_file ~/.irssi/away.log - Выбирает файл для лога
</pre>
<p>Простейший способ ведения логов при помощи Irssi - включение автолога.
Irssi будет вести логи всех сообщений в заданный каталог.
Вы можете включить его при помощи следующей команды:</p>
<pre>
/SET autolog ON
</pre>
<p>По умолчанию в логи записывается почти всё кроме уровней CTCPS или CRAP
(<code>/WHOIS</code>-запросы и.т.д.). Вы можете задать уровни сообщений, которые надо писать в логи следующей командой:</p>
<pre>
/SET autolog_level ALL -CRAP -CLIENTCRAP -CTCPS (this is the default)
</pre>
<p>По умолчанию irssi пишет лог в ~/irclogs/<метка_сервера>/<цель>.log.
<p>Если заданный каталог не существует, то он автоматически создается. В переменной $0
содержится цель(канал или ник). Вы можете настроить Irssi так, чтобы он автоматически добавлял дату/время к имени файла с логом.
Вормат даты - "man strftime" :). Вот пример:</p>
<pre>
/SET autolog_path ~/irclogs/%Y/$tag/$0.%m-%d.log
</pre>
<p>Чтобы вести логи только по каким-то отдельным каналам или никам смотрите <code>/HELP
log</code></p>
<h3><aid="c9">9. Изменение клавиатурных сочетаний</a></h3>
<p>Вы можете изменить любое клавиатурное сочетание, о котором терминал даёт знать irssi.
То есть irssi "видит" не все клавиатурные сочетания, например он не будет реагировать на
shift-backspace если вы как-то не отредактируете соответствующие X-ресурсы.</p>
<p>Команда <code>/HELP bind</code> даёт намного больше информации о клавиатурных сочетаниях, чем приведено здесь.
Обычно проблеммой является "забивание" каких-то не стандартных клавиш.
Они немного различны для каждого терминала, так что вы должны будете узнать что именно даёт нажатие этой клавиши.
Простейший путь узнать это - выполнить в консоли <code>cat</code> и посмотреть что будет выводится при нажатии этой клавиши.
Вот пример нажатия клавиши F1:</p>
<pre>
[cras@hurina] ~% cat
^[OP
</pre>
<p>Так что в irssi чтобы "забить" что-то на F1 вы должны будете использовать команду <code>/BIND ^[OP /ECHO нажата клавиша F1</code>.
Если вы используете разные терминалы, которые по разному распознают нажатие одной и той-же клавиши, то вам лучше использовать что-то вроде этого:</p>
<pre>
/BIND ^[OP key F1
/BIND ^[11~ key F1
/BIND F1 /ECHO нажата клавиша F1.
</pre>
<h3><aid="c10">10. Прокси и боунсеры</a></h3>
<p>Irssi поддерживает подключение к IRC-серверам через прокси. Если вы всё правильно сделаете, то все подключения будут осуществляться через него и вам не надо будет вводить никаких дополнительных команд.</p>
<p>Вот пример: У вас есть боунсер, висящий на
irc.bouncer.org 5000. Вы хотите использовать его для подключения к серверам irc.dal.net и irc.efnet.org. Для начала вы должны будете настроить боунсер:</p>
<pre>
/SET use_proxy ON (включить использование прокси)
/SET proxy_address irc.bouncer.org
/SET proxy_port 5000
/SET proxy_password ВАШ_ПАРОЛЬ
/SET -clear proxy_string
/SET proxy_string_after conn %s %d
</pre>
<p>Потом вам нужно будет добавить нужные серверы. Это делается точно так-же, как если бы вы хотели подключиться к ним напрямую:</p>
<pre>
/SERVER ADD -auto -ircnet dalnet irc.dal.net
/SERVER ADD -auto -ircnet efnet irc.efnet.org
</pre>
<p>После того, как вы сделали вышеперечисленные настройки все соединения irssi будет производить через проксю.</p>
<p>Если вы не хотите использовать проксю для какого-то сервера, то при его добавлении укажите опцию
<code>-noproxy</code>.</p>
<p><strong>Специфичные настройки для разных типов прокси:</strong></p>
<p>Обычные настройки:</p>
<pre>
/SET use_proxy ON
/SET proxy_address <Адрес прокси>
/SET proxy_port <Порт>
</pre>
<p><strong>HTTP proxy</strong></p>
<p>Используйте эти настройки для HTTP-прокси:</p>
<pre>
/SET -clear proxy_password
/EVAL SET proxy_string CONNECT %s:%d\n\n
</pre>
<p><strong>BNC</strong></p>
<pre>
/SET proxy_password ваш_пароль
/SET -clear proxy_string
/SET proxy_string_after conn %s %d
</pre>
<p><strong>dircproxy</strong></p>
<p>dircproxy производит подключения к серверам по паролям. Так что если например вы хотите подключиться к серверу ircnet с паролем ircpass
и к OFTC с паролем oftcpass, вы должны сделать примерно следующее:</p>
<p>Здесь при помощи команды <code>/IRCNET ADD</code> вы задаете имена пользователей
и пароли при помощи <code>/SERVER ADD</code>.</p>
<p><strong>Irssi proxy</strong></p>
<p>Irssi включает свою собственную проксю, которую вы можете собрать при помощи опции configure
<code>--with-proxy</code>. Чтобы её использовать вы должны оставлять irssi запущенным.</p>
<p>Irssi-прокся немного отличается от остальных прокси-серверов, нормальные прокси создают новые соединения с IRC-сервером когда вы хотите к нему подключиться, а
<strong>irssi-прокся использует уже существующее соединение(я) для всех клиентов</strong>. Или ещё понятнее: <strong>Вы можете использовать только одно соединение с IRC-сервером для неограниченного числа клиентов</strong>.</p>
<p>Irssi-прокся может распределять несколько соединений с серверами на разные порты, например на 2777-ом порту у вас может быть соединение с ircnet, а на 2778 с efnet.</p>
<p>Irssi-прокся так-же нормально работает с другими irc-клиентами.</p>
<p><strong>SOCKS</strong></p>
Irssi может быть собран с поддержкой socks-прокси (опция configure <code>--with-socks</code>),
но я на самом деле не знаю как оно работает. Настройки <code>/SET
proxy</code> на эти прокси никак не действуют.
<p><strong>Другие прокси</strong></p>
<p>IRC-боунсеры обычно работают точно так-же как и IRC-серверы, но просят пароль. Вы можете дать им его при помощи следующей команды:</p>
<pre>
/SET proxy_password <пароль>
</pre>
<p>CONNECT-строки по умолчанию:</p>
<pre>
/SET proxy_string CONNECT %s %d
/SET proxy_string_after
</pre>
<p>proxy_string отправляются перед командами NICK/USER, а
proxy_string_after отправляется после них. %s and %d can be used with both
of them.</p>
<h3><aid="c11">11. Настройки Irssi</a></h3>
<p>Вам могут не понравится настройки Irssi по умолчанию.
Вот некоторые из них, которые вы скорее всего захотите изменить(в примерах приведены "умолчальные" значения):</p>
<p><strong>Окна приватов</strong></p>
<dl>
<dt>/SET autocreate_own_query ON</dt>
<dd>Автоматически создавать окно привата когда вы отправляете кому-то сообщение при помощи команды <code>/MSG</code>.</dd>
<dt>/SET autocreate_query_level MSGS</dt>
<dd>При получении сообщений окно привата создается с этим уровнем сообщений. Сейчас работают только MSGS, DCCMSGS и NOTICES.
Вы можете отменить это при помощи команды <code>/SET -clear autocreate_query_level</code>.</dd>
<dt>/SET autoclose_query 0</dt>
<dd>Окна приватов могут быть автоматически закрыты после заданного "простоя". Активное окно и окна с непрочитанными сообщениями не закрываются. Значение задается в секундах.</dd>
</dl>
<p><strong>Окна</strong></p>
<dl>
<dt>/SET use_msgs_window OFF</dt>
<dd>Создавать окно сообщений при запуске. Все приватные сообщения будут направляться в это окно.
Это имеет смысл только если вы отменили автосоздание окон приватов.
Это окно так-же может быть создано вручную при помощи команды /WINDOW LEVEL
MSGS, /WINDOW NAME (msgs).</dd>
<dt>/SET use_status_window ON</dt>
<dd>Создавать окно статуса при запуске. Все сообщения, которые больше некуда отправить идут сюда, включая /WHOIS и.т.д.
Окно статуса тоже может быть создано вручную при помощи команд <code>/WINDOW LEVEL ALL -MSGS</code>,
<code>/WINDOW NAME (status)</code>.</dd>
<dt>/SET autocreate_windows ON</dt>
<dd>Если вы это отключите, то все сообщения будут помещаться в одно окно</dd>
<dt>/SET autoclose_windows ON</dt>
<dd>Автозакрытие окон (например при выходе с каналов(<code>/PART</code>)).</dd>
<dt>/SET reuse_unused_windows OFF</dt>
<dd>Когда ищется место для создания нового окна (канала или привата) Irssi
сначала пытается использовать уже существующие пустые окна. Если эта опция включена, то всегда будут создаваться новые окна.
Эта настройка игнорируется если autoclose_windows включен.</dd>
<dt>/SET window_auto_change OFF</dt>
<dd>Автоматически переключаться в автоматически созданные окна.</dd>
<dt>/SET print_active_channel OFF</dt>
<dd>Когда вы держите в одном окне больше чем один канал, Irssi выводит сообщения, приходящие на активный канал в форме <code><ник> текст</code>
а те, что приходят на другие каналы так: <code><ник:канал> текст</code>. Если эта опция включена, то сообщения, приходящие на активный канал будут так-же выводиться во втором варианте.</dd>
<dt>/SET window_history OFF</dt>
<dd>Хранить отдельную историю команд для каждого окна.</dd>
</dl>
<p><strong>Информация о пользователе</strong></p>
<dl>
<dt>/SET nick</dt>
<dd>Ваш ник</dd>
<dt>/SET alternate_nick</dt>
<dd>Ваш альтернативный ник.</dd>
<dt>/SET user_name</dt>
<dd>Ваше имя пользователя. Если у вас включен ident, то оно ничего не даёт.</dd>
<dt>/SET real_name</dt>
<dd>Ваше настоящее имя.</dd>
</dl>
<p><strong>Информация о сервере</strong></p>
<dl>
<dt>/SET skip_motd OFF</dt>
<dd>Пропускать motd при подключении к серверу.</dd>
<dt>/SET server_reconnect_time 300</dt>
<dd>Сколько секунд надо ждать перед повторной попыткой подключения к серверу.</dd>
<dt>/SET lag_max_before_disconnect 300</dt>
<dd>При каком лаге(в секундах) надо отключаться от сервера и предпринимать попытку переподключения.</dd>
</dl>
<p><strong>Внешний вид</strong></p>
<dl>
<dt>/SET timestamps ON</dt>
<dd>Показывать время перед каждым сообщением.</dd>
<dt>/SET hide_text_style OFF</dt>
<dd>Скрыть оформление текста(жирный шрифт, цвета и.т.д.).</dd>
<dd>Если у ника нет режима - выводить пробел на месте "символа режима".</dd>
<dt>/SET show_quit_once OFF</dt>
<dd>Показывать quit-сообщение только в одном окне, если человек вышел с нескольких каналов, на которых вы сидите.</dd>
<dt>/SET lag_min_show 100</dt>
<dd>Показывать в статус-баре лаг если он превышает заданное число юнитов. В одной секунде 100 юнитов.</dd>
<dt>/SET indent 10</dt>
<dd>Если строка, которую надо вывести не вмещается в одну строку, то она разбивается и выводится на следующих строках. Этот параметр показывает сколько места надо отступить перед началом вывода текста на следующих строках.
Это может быть переопределено в настройках форматирования текста при помощи формата <code>%|</code>.</dd>
<dt>/SET activity_hide_targets</dt>
<dd>Если вы не хотите видеть активность на каких-то каналах или приватах, то перечислите их здесь. Например <code>#boringchannel =bot1
=bot2</code>. Эта настройка игнорируется если встречается текст или сообщение, для которого вы настроили подсветку(highlight).</dd>
</dl>
<p><strong>Автодополнение ников</strong></p>
<dl>
<dt>/SET completion_auto OFF</dt>
<dd>Автоматически дополнять ник если строка начинается с первых букв ника и "символа автодополнения".
Лучше всего использовать автодополнение табом.</dd>
<dt>/SET completion_char :</dt>
<dd>"Символ автодополнения".</dd>
</dl>
<h3><aid="c12">12. Панель статуса</a></h3>
<p>Команда <code>/STATUSBAR</code> выводит список панелей статуса:</p>
<pre>
Name Type Placement Position Visible
window window bottom 0 always
window_inact window bottom 1 inactive
prompt root bottom 100 always
topic root top 1 always
</pre>
<p><code>/STATUSBAR <имя></code> выводит настройки панели статуса и её компоненты.