Skip to content

Fix the CLI --console flag never showing the pre-request script output - #218

Merged
Julien-cpsn merged 1 commit into
Julien-cpsn:mainfrom
ybai08:fix/cli-console-pre-request-output
Oct 19, 2026
Merged

Julien-cpsn merged 1 commit into
Julien-cpsn:mainfrom
ybai08:fix/cli-console-pre-request-output

Conversation

@ybai08

@ybai08 ybai08 commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

atac request send --console builds its output from (post_request_output, post_request_output) instead of (pre_request_output, post_request_output). So the pre-request script output is never printed, and when there is a post-request script its output is printed twice:

$ atac -d <dir> request send console/scripts --console --hide-content --dry-run
post ran

post ran

This PR changes the first element of the tuple to pre_request_output. The TUI's console tab (tui_logic/result_tabs.rs) already uses the right pair.

Test: tests/cli_console.rs runs the atac binary (CARGO_BIN_EXE_atac) on a collection in a temporary directory. The request has a pre- and a post-request script that both console.log, and it goes to a one-shot local TcpListener. The test checks that each output appears exactly once. On main it fails with left: 0, right: 1 and stdout "post-request output\n\npost-request output\n\n".

What was run:

  • cargo test: 37 unit tests plus the new integration test pass. The integration test was run 3 more times and passed each time.
  • cargo clippy --all-targets: same warning count as main.

The console output was matched as (post, post) instead of (pre, post), so `atac request send --console` printed the post-request output twice and never the pre-request output.
@Julien-cpsn
Julien-cpsn merged commit f976ee5 into Julien-cpsn:main Oct 19, 2026
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