Skip to content

Remove accidental set -x debug tracing#156

Open
Marcel-Bich wants to merge 1 commit intotmux-plugins:masterfrom
Marcel-Bich:fix/remove-debug-tracing
Open

Remove accidental set -x debug tracing#156
Marcel-Bich wants to merge 1 commit intotmux-plugins:masterfrom
Marcel-Bich:fix/remove-debug-tracing

Conversation

@Marcel-Bich
Copy link

Summary

Remove the set -x bash debug flag from continuum.tmux line 3 that was accidentally left in since commit 05a4a82 (2015-11-23).

Problem

The set -x flag causes every command executed during plugin initialization to be traced to stderr. While this is harmless with most terminal emulators, it creates a feedback loop with terminals that handle run-shell stderr output differently (notably Kitty with xterm-kitty terminfo):

  1. set -x generates stderr output during plugin operations
  2. stderr output triggers tmux monitor-activity flags
  3. Activity flags trigger notification hooks (run-shell commands)
  4. Those hooks generate more activity, spawning more processes
  5. With many sessions/clients, this compounds into 40,000+ context switches/sec and 100% CPU

Fix

Remove the single set -x line. No functional changes -- this line only enables debug tracing that was part of the systemd support development in 2015.

Testing

  • Tested with 19 tmux sessions, 13 attached Kitty clients
  • Before: 100% CPU, load average 22-29 on 8 cores, ~47 parallel continuum processes
  • After removing set -x: CPU returns to normal idle levels

The set -x on line 3 was introduced in commit 05a4a82 (2015) during
systemd support development and was never removed. It causes all
commands to be traced to stderr during plugin initialization.

With terminal emulators that process stderr output from tmux run-shell
commands differently (e.g. Kitty with xterm-kitty terminfo), this
debug output can trigger monitor-activity hooks, creating a feedback
loop that results in exponential process spawning and 100% CPU usage.
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.

1 participant