Skip to content

Conversation

@balejk
Copy link
Contributor

@balejk balejk commented Dec 10, 2025

  • I ran valgrind when using my new feature

How to test the functionality

  • step 1

Launch profanity and connect to server. Verify it can be seen as connected by other clients.

  • step 2

Send SIGTERM to it or close the terminal it's running in. Verify in the other clients that it immediately comes offline, rather than only after a while when the connection times out.

@jubalh
Copy link
Member

jubalh commented Jan 22, 2026

Sorry for the long time to wait and thank you for your PR.

I guess this is useful to cleanup properly, update our presence (do we even do that?) and close the connection properly.

I would appreciate if you could expand the commit message a bit. For example adding to the commit body why you do this, the purpose.

While at it you can also remove the profanity: on the first commit line.

Copy link
Member

@jubalh jubalh left a comment

Choose a reason for hiding this comment

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

see comment

@jubalh jubalh added this to the next milestone Jan 22, 2026
Make profanity exit gracefully when it receives either SIGTERM or
SIGHUP. This means that various cleanups will happen as if the user
issued the /quit command, whereas before these signals would terminate
profanity immediately leaving for instance the connection to the server
unterminated.

The main motivation for this change is so that profanity will exit
gracefully when the user closes the terminal that it's running in, which
is a handy shortcut (but can also happen on accident) and won't now lead
to the connection slowly timing out on the server instead. Similarly for
SIGTERM: profanity now for instance needs not be manually closed before
shutting down the computer to avoid the above as it will instead receive
this signal from the init process.
@balejk
Copy link
Contributor Author

balejk commented Jan 22, 2026 via email

@jubalh jubalh merged commit fce4da4 into profanity-im:master Jan 22, 2026
5 checks passed
@jubalh
Copy link
Member

jubalh commented Jan 22, 2026

Thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants