on channel_claim
Synopsis
/on [<noise>]channel_claim "<pattern>" [(<argument list>)] { <commands> }
Description
Triggered while EPIC adds or recreates a channel record, before assigning its window. This lets scripts choose which window receives the channel.
Use standard on matching, serial numbers, and noise controls. The pattern matches the complete event data.
Parameters
| Parameter | Meaning |
|---|---|
$0 |
Server refnum. |
$1 |
Channel name. |
$2 |
Proposed window reference, using the internal window identifier rather than necessarily its user-visible refnum. |
Behavior
EPIC proposes the previous window when available, otherwise a window waiting for the channel, otherwise the server’s current window. During the hook, window claim can nominate a window on the same server: window <window> claim <channel>. The last successful claim wins. Claiming is allowed only during this interval and must match the channel and server.
The hook’s suppression result is ignored; suppression cannot cancel the addition or window assignment. This occurs before channel synchronization finishes; see on channel_sync.
Example
on -channel_claim "% #support *" {
echo Assigning $1 on server $0;
};
Source references
source/names.c:add_channelselects the proposed window;window_claims_channelrecords overrides.source/window.c:windowcmd_claimimplements the claim command.source/hook.c: event registration and standard hook dispatch.