fish avoids an iTerm2 warning by removing directory notifications
fish 2.7.1 fixes iTerm2's paste-bracketing warning by disabling one directory-notification path. Bracketed paste remains enabled, so the repair is more specific than turning off paste protection.
A terminal warning about paste bracketing can originate in another part of shell integration. fish 2.7.1 addresses the warning iTerm2 displays when a new fish session starts. The patch removes iTerm2 from a directory-notification condition while leaving fish's bracketed-paste machinery in place.
The December 23 release notes describe the visible symptom. The tagged interactive setup code shows the narrower implementation change. This is a terminal-compatibility release whose explanation depends on distinguishing the warning's wording from the code removed to avoid it.
I value fish's polished interaction because the terminal is where the shell's behavior becomes visible. A warning during startup deserves a precise explanation, particularly when disabling an unrelated-looking integration is enough to remove it.
Directory reporting and paste handling meet during startup
In the 2.7.0 setup code, fish installs a directory-change handler for several terminal configurations. The condition includes sufficiently recent VTE terminals, Apple's Terminal and TERM_PROGRAM equal to iTerm.app.
The handler reports the hostname and current directory through an OSC 7 sequence. It runs when PWD changes and also runs immediately after installation. That initial call matters because the shell may already have inherited a directory before the handler existed.
Version 2.7.1 removes the iTerm.app branch from that condition. The VTE and Apple Terminal checks remain. For a session that matched only the iTerm branch, fish no longer installs that reporting path.
This is more specific than correcting a generic bracketed-paste on/off switch. The relevant change is the removal of one terminal's automatic directory-reporting integration. The release still contains separate functions for enabling and disabling bracketed paste.
The pre-release discussion leaves some mechanism unresolved
The issue discussion in November and December connects the warning to directory notifications and prompt recognition. On December 17, a maintainer offers an explanation involving iTerm's interpretation of the directory sequence as a prompt marker and fish's enabling of bracketed paste at prompts.
That explanation is tentative. The maintainer explicitly raises questions about ordering and what iTerm expects. On December 22, another maintainer agrees that backing out the behavior makes sense and discusses issuing a point release.
These comments support an account of the decision without requiring certainty about every detail of the terminal's internal detection logic. The released code establishes what fish changes. The contemporaneous discussion explains why removing that integration was considered a suitable repair.
It is therefore more accurate to describe 2.7.1 as avoiding the interaction than to claim it redesigns the terminal protocol. The patch does not add a new comprehensive prompt-detection implementation for iTerm2.
Bracketed paste remains a separate feature
The setup code enables bracketed paste before prompts and disables it before commands, which may not support the mode. It also associates the disabling function with exit of the current fish process. Those lifecycle handlers remain present in the patched release.
The shared key bindings explain the protocol. After the shell announces support, the terminal surrounds pasted text with start and end sequences. fish switches into a paste mode for the enclosed text.
Inside that mode, ordinary characters insert themselves instead of invoking normal editing bindings. This prevents a pasted newline from acting like a separately typed command-execution key. At the end marker, fish restores the previous binding mode and repaints the command line.
The code also handles pasted text inside an unbalanced single-quoted token by escaping single quotes and backslashes. This is context-sensitive handling of the command buffer, not simply a terminal preference named paste protection.
The clipboard helper keeps its documented role
Comments in the binding implementation still recommend fish_clipboard_paste where available. They describe limitations in the bracketed-paste path, including repeated highlighting and treatment of paste-stop sequences in terminal input. Those qualifications existed alongside the feature and are not new claims introduced by this patch.
The distinction is between a shell function obtaining clipboard data and a terminal delivering a stream marked as pasted text. Both can improve pasting, but they obtain the data through different paths. Fixing directory notifications does not collapse them into one implementation.
I prefer retaining the useful paste behavior while removing the particular integration that triggers a misleading startup warning. That is the scope visible in the patch, and it explains why users should not expect the release to remove bracketed paste from fish generally.
The remaining tradeoff is directory reporting through the removed iTerm-specific path. fish continues to change its working directory normally, but this setup condition no longer advertises those changes to iTerm through that handler. Version 2.7.1 resolves the reported startup warning by narrowing terminal integration while preserving the existing paste bindings and their mode transitions.