Skip to content
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

Move closehandler to pkg, move feedback form to closehandler #72

Merged
merged 3 commits into from
Dec 15, 2020

Conversation

denny241
Copy link
Contributor

Closes #71

There is still a bug where several instances of "Goodbye" will be printed at the end because a separate closehandler seems to be needed for every pkg inside of which the user might press CTRL+C; a way of closing the closehandler without closing the program is the next step

@denny241 denny241 added the WIP Work in progress label Dec 10, 2020
@@ -29,8 +29,6 @@ var rootCmd = &cobra.Command{
func init() {
cobra.OnInitialize(initLogger)

displayOptions.FeedbackFormURL = "https://forms.gle/K9ga7FZB3deaffnV7"
Copy link
Contributor

Choose a reason for hiding this comment

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

Would that be possible to leave it here and pass displayOptions to closehandler?

func ForwardPort(config lm.ExposeHttpConfig) {
setupCloseHandler(config.Display.FeedbackFormURL)
closehandler.SetupCloseHandler()
Copy link
Contributor

Choose a reason for hiding this comment

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

what if you would set it up in the commands only? E.g. in each relevant Run method, or even PreRun? I think it should then not duplicate the output and should be enough to fix ctrl c breaking temrinal

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't remember why I thought that it needs to be setup in every command separately, after some testing I just moved it to the init of the root command and it worked for both ssh and basic auth.

@denny241 denny241 removed the WIP Work in progress label Dec 14, 2020
}

//SuccessfulConnectionOccured sets the corresponding boolean to true, enabling the display of the feedback form URL after closing the CLI
func SuccessfulConnectionOccured() {
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe MarkConnectionSuccessful instead?

@Morishiri Morishiri force-pushed the fix/invisible-terminals-in-pkgs branch from dac5642 to 9052e3d Compare December 15, 2020 13:34
@Morishiri Morishiri merged commit bbd497f into master Dec 15, 2020
@Morishiri Morishiri deleted the fix/invisible-terminals-in-pkgs branch March 2, 2021 10:24
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.

Terminal is stuck after using CTRL-C when prompted for password
2 participants