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

fix(quit): allow to quit atac inside selected requests #50

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

NachoNievaG
Copy link

Proposal

I always find myself executing a request, copying the result, and trying to quit as soon as i copy the result.
But currently quitting with q only works in the "normal" view, so quitting requires ctrl+c or Esc -> q.
With this, you will be able to quit using q on a selected request.
Thanks!

@Julien-cpsn
Copy link
Owner

Hello @NachoNievaG

I understand what is your problem, but I found another problem with what you did.

On platforms such as Windows or many Linux distros, ctrl-c is used to copy text from the terminal. Imagine that I want to manually copy the request URL onto my clipboard, with your code it will exit the app (without even copying the text).

If you find another way, let me know! I'll try to think about that in "passive" mode

Have a great day!!!

@@ -261,6 +261,7 @@ impl AppState {
};

let mut base_events: Vec<AppEvent> = vec![
ExitApp(EventKeyBinding::new(vec![key_bindings.main_menu.exit, key!(ctrl-c)], "Exit", Some("Exit"))),
Copy link
Author

Choose a reason for hiding this comment

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

@Julien-cpsn

On platforms such as Windows or many Linux distros, ctrl-c is used to copy text from the terminal. Imagine that I want to manually copy the request URL onto my clipboard, with your code it will exit the app (without even copying the text).

Oops, you are right, I'm still not used to think of this as a multi-platform bin.
wouldn't this be enough?

Suggested change
ExitApp(EventKeyBinding::new(vec![key_bindings.main_menu.exit, key!(ctrl-c)], "Exit", Some("Exit"))),
ExitApp(EventKeyBinding::new(vec![key_bindings.main_menu.exit], "Exit", Some("Exit"))),

@NachoNievaG NachoNievaG force-pushed the fix/quit_on_selected_screen branch from 37736b8 to 95d8e06 Compare May 4, 2024 17:41
@Julien-cpsn
Copy link
Owner

Julien-cpsn commented May 5, 2024

@NachoNievaG I took some time to think of something that could resolve your problem without needing a special implementation, and I think I found it!

One of the next features that I will work on will be command line usage. As we discussed it a little on the import curl PR, I will try to make it very complete.

E.g. regarding your problem, you could send a request with

atac send my_collection/my_request

By default it will return the response body. But by adding things like -s --status-code, -h --headers, -c --cookies, --console or --no-content the app will output will be kind of customized.

Back to your problem, you could simply copy the output from the command line usage. What about that?

Have a great day!

@NachoNievaG
Copy link
Author

@Julien-cpsn
I'm really sorry but it does not. In this particular scenario it makes a weird experience for closing the program.

In a "fast" workflow as soon as i get the output i would like to be able to quit the program/floating term.
PS: the circle with an arrow it's the prompt for "Esc"

Natural TUI example

Screen.Recording.2024-05-06.at.17.36.13.mov

Neovim Plugin example

Screen.Recording.2024-05-06.at.17.29.13.mov

Maybe i'm not using the software as intended to be.

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.

None yet

2 participants