Skip to content

fix: do not wipe claude buffer on window close (native) #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

alvarosevilla95
Copy link
Contributor

@alvarosevilla95 alvarosevilla95 commented Jun 22, 2025

Summary

The native provider had a behavior where closing the claude window wiped the buffer, rather than hiding it, which is different from the snacks behavior. It means it was very easy to accidentally terminate the session when trying to hide the buffer.

This changes it so the buffer is hidden on close instead, behaving like snacks

@alvarosevilla95 alvarosevilla95 changed the title fix: add window validation in terminal focus toggle fix: add terminal window validation and configurable persistence Jun 22, 2025
@alvarosevilla95 alvarosevilla95 force-pushed the fix/terminal-window-validation branch from e942ac9 to 8101128 Compare June 22, 2025 20:52
@ThomasK33
Copy link
Member

Hey, thanks for opening this PR.

What's the difference between this new field and the already existing terminal.auto_close option?

@alvarosevilla95 alvarosevilla95 force-pushed the fix/terminal-window-validation branch from 8101128 to ef0592f Compare July 31, 2025 11:00
@alvarosevilla95
Copy link
Contributor Author

Hey, thanks for opening this PR.

What's the difference between this new field and the already existing terminal.auto_close option?

I think I overcomplicated this a bit. The main issue was that on the native provider, closing the claude window triggered a buffer delete, rather than hiding it as it happens on snacks. changed the PR to only address that issue

@alvarosevilla95 alvarosevilla95 changed the title fix: add terminal window validation and configurable persistence fix: do not wipe claude buffer on window close (native) Jul 31, 2025
@ThomasK33
Copy link
Member

You'll have to update the tests, as they still expect wipe instead of hide.
Aaprt from that LGTM.

changes the expected value of 'wipe' to 'hide'.
Remove check for buffer options as they will be undefined, given that
`nvim_buf_set_option` will now have been called.
@alvarosevilla95
Copy link
Contributor Author

ah yes sorry, forgot about that 😅

Copy link
Member

@ThomasK33 ThomasK33 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

@ThomasK33 ThomasK33 added this pull request to the merge queue Aug 4, 2025
Merged via the queue into coder:main with commit 1da5f67 Aug 4, 2025
4 checks passed
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.

2 participants