Skip to content

doc: clarify that Vty from customMainWithDefaultVty needs shutdown#530

Merged
jtdaugherty merged 1 commit intojtdaugherty:masterfrom
frasertweedale:doc/vty-needs-shutdown
Jun 22, 2025
Merged

doc: clarify that Vty from customMainWithDefaultVty needs shutdown#530
jtdaugherty merged 1 commit intojtdaugherty:masterfrom
frasertweedale:doc/vty-needs-shutdown

Conversation

@frasertweedale
Copy link
Copy Markdown
Contributor

@frasertweedale frasertweedale commented Jun 21, 2025

I wondered whether perhaps customMainWithDefaultVty ought to shut down the vty it creates, but since the return type includes the Vty, we probably should leave it as is, and just update the doc to clarify that it needs to be shut down.

@jtdaugherty
Copy link
Copy Markdown
Owner

Yes, the shutdown call is deferred to the caller specifically because otherwise the returned Vty handle would not be useful. The use case for those functions is one in which the caller wants to maintain control of the terminal after the Brick application halts but before other work is carried out by the caller that would require control of the terminal (and in which a shutdown-induced state restoration would be visually undesirable).

As for the change here, my hope had been that the docs imply this in the chain of "Like " but I'm happy to merge this to make it clearer. Thanks!

@jtdaugherty jtdaugherty merged commit b9230b1 into jtdaugherty:master Jun 22, 2025
0 of 8 checks passed
@frasertweedale frasertweedale deleted the doc/vty-needs-shutdown branch June 22, 2025 13:47
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