Skip to content

[inputlength] Add feature to count backwards from the maximum possible length - #914

Merged
bw1 merged 5 commits into
irssi:masterfrom
kontaxis:inputlength_countdown_auto
Aug 19, 2026
Merged

bw1 merged 5 commits into
irssi:masterfrom
kontaxis:inputlength_countdown_auto

Conversation

@kontaxis

@kontaxis kontaxis commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

This change adds boolean setting inputlength_countdown. When ON, instead of counting the length of inputline up from zero, it counts down from the maximum length of a contiguous message per RFC 1459, i.e., 512 minus overhead.

The code dynamically determines the overhead given the current nickname, userhost, and channel.

This is useful when the user wants avoid their message being split into two, e.g., because they are over the limit by a word.

Setting inputlength_countdown is OFF by default.

This change also adds an integer setting inputlength_offset. Its value is added to the actual length of inputline. This is useful when other settings affect the final length, e.g., split_line_start or split_line_end. In that case inputlength_offset should be set to account for those additional characters.

As an example, when split_line_end = "> " and split_line_start = " >" then inputlength_offset = 4.

Setting inputlength_offset is 0 by default.

@kontaxis
kontaxis force-pushed the inputlength_countdown_auto branch from d7eaf4f to 7aefaca Compare August 16, 2026 11:29
@bw1
bw1 merged commit b2d3ebe into irssi:master Aug 19, 2026
1 check passed
@bw1

bw1 commented Aug 19, 2026

Copy link
Copy Markdown
Member

thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants