Skip to content

exit follow mode when search or filter is cancelled - #2050

Merged
fasterit merged 1 commit into
htop-dev:mainfrom
OldUser101:search-unfollow-fix
Aug 2, 2026
Merged

exit follow mode when search or filter is cancelled#2050
fasterit merged 1 commit into
htop-dev:mainfrom
OldUser101:search-unfollow-fix

Conversation

@OldUser101

Copy link
Copy Markdown
Contributor

condition change in bbec22d caused panel state during search to persist after the search was cancelled (e.g. escape key). previous behaviour relied on the absence of the HTOP_KEEP_FOLLOWING reaction to stop following, which is no longer the case.

explicitly setting host->activeTable->following to -1 now, has the same effect as not setting HTOP_KEEP_FOLLOWING did before bbec22d.

condition change in bbec22d caused
panel state during search to persist even if the search was cancelled
(e.g. escape key). previous behaviour relied on the absence of the
`HTOP_KEEP_FOLLOWING` reaction to stop following, which is no longer
the case.
@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f6ee481f-31a2-41e5-a610-2f06a93f7891

📥 Commits

Reviewing files that changed from the base of the PR and between d4297a4 and 56eb257.

📒 Files selected for processing (1)
  • MainPanel.c

📝 Walkthrough

Walkthrough

MainPanel_eventHandler now resets host->activeTable->following to -1 when neither an active search match nor a confirmed search is present.

Suggested reviewers: benbe

Poem

A search may lead, then lose its way,
The table clears its follow sway.
When no match calls, the state resets,
And rows return to calm defaults.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@fasterit

Copy link
Copy Markdown
Member

Hm, do we want that? Do we want to guard it with the stickyFollow setting?

@OldUser101

OldUser101 commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

The behaviour I would expect is not to follow unless there is either a search match, or the search has been confirmed (e.g. pressing Enter).

At the very least cancelling a failed search shouldn't keep following whatever was selected by it, probably in error.

in regard to stickyFollow, I'm not sure if it's really relevant here since it currently serves a different purpose of keeping the followed item visible.

I also feel the current behaviour contradicts the intended behaviour of 7d7baeb: a process being followed when confirmed in the search. Currently, every search match, failed or not, will be followed whether the search was confirmed or aborted.

@fasterit
fasterit merged commit 7ba14f6 into htop-dev:main Aug 2, 2026
21 checks passed
@BenBE BenBE added the enhancement Extension or improvement to existing feature label Aug 4, 2026
@BenBE BenBE added this to the 3.6.0 milestone Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Extension or improvement to existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants