Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Terminal query artifacts and backward compatibility issue in zsh-dev version



Guten Tag, 

I have noticed an issue with the current dev version of zsh.

Environment:
- macOS 15
- ZSH_PATCHLEVEL=zsh-5.9.0.2-test-136-g4a99cc2
- TERM_PROGRAM=Apple_Terminal
- TERM_PROGRAM_VERSION=455.1

To reproduce:

1. Get macOS and the latest zsh development version
2. Open zsh in Apple’s default Terminal.app and run

```bash
script -q /dev/null zsh -i -c "sleep 100"
```

3. Notice you see '+q524742' (from the XTTERMCAP RGB query) below the command

Bisect:

https://github.com/zsh-users/zsh/commit/37acbc87ad76

My observations:

- The feature occasionally causes artifacts to appear in Terminal.app, though
  only very briefly, and they are always cleared automatically. I tested this
  also with Ghostty, which shows no artifacts.
- Some terminal applications like ‘aider’ spawn an interactive shell to execute
  their commands, where the ‘+q524742’ also becomes visible.
- The startup delay (before and after the bisected commit) is mostly the same,
  but occasionally the appearance of the artifact can create a scenario where it
  affects startup speed, although the infrequent visual artifact itself is the
  main issue.

Workaround: Disabling works as documented:

```bash
# .zshenv
.term.extensions=( -query )
```

BUT this relies on the new namespace syntax, which breaks any script using an
older zsh (e.g., /bin/zsh on macOS is 5.9).

- Ref: https://github.com/zsh-users/zsh/commit/a9ba16621658

Reading .zshenv with the new syntax causes:

```bash
.zshenv:19: unknown file attribute:
```

This broke some cron jobs for me, forcing adjustments. I’m aware of zsh -f, but
some third‑party tools may alter the PATH or use hardcoded paths and flags for
shell execution, like aider.

Bloated workaround to disable the feature:

```bash
# .zshenv
autoload -Uz is-at-least
if [[ $ZSH_VERSION != 5.9 ]] && is-at-least 5.9; then
  .term.extensions=( -query )
fi
```

Questions:

- A) Can the feature become opt‑in instead of opt‑out?
- B) Can a backward‑compatible way to disable the feature without an
  if‑statement be added, e.g., an environment variable such as: export
  ZSH_TERM_QUERIES='no' ?





Messages sorted by: Reverse Date, Date, Thread, Author