Skip to content

fix: resolve jbang deps search hang on Windows #2549 - #2568

Merged
maxandersen merged 1 commit into
jbangdev:mainfrom
arnabnandy7:fix/windows-deps-search
Jun 28, 2026
Merged

fix: resolve jbang deps search hang on Windows #2549#2568
maxandersen merged 1 commit into
jbangdev:mainfrom
arnabnandy7:fix/windows-deps-search

Conversation

@arnabnandy7

@arnabnandy7 arnabnandy7 commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Title

fix: resolve jbang deps search hang on Windows

Fixes #2549

Description

This PR resolves the issue where jbang deps search hangs indefinitely and produces no output when run on Windows.

Cause

The terminal backend in JBang for the deps search TUI widget is implemented using TamboUI's tamboui-aesh-backend.

By default, the backend's constructor instantiates a new org.aesh.terminal.tty.TerminalConnection to connect to the system terminal. However, because JBang is already running within an active Aesh shell session, trying to open a second native system terminal connection to the same console session on Windows results in a conflict/deadlock, causing the process to hang without displaying the UI.

Solution

  • Modified Deps.java to extract the active org.aesh.terminal.Connection instance from Aesh's command invocation context using commandInvocation.getShell().connection().
  • Updated ArtifactSearchWidget.java to support an overloaded search(Connection connection, String initialQuery) method.
  • Reconfigured the TUI initialization to reuse the connection if it's available:
    AeshBackend backend = new AeshBackend(connection);
    TuiConfig config = TuiConfig.defaults().toBuilder().backend(backend).build();
  • If no connection is passed (e.g. falls back to default), it defaults back to creating a new terminal connection.

@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • ai-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0eb75889-fd25-4261-a0c3-f1b29ae6556b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@arnabnandy7 arnabnandy7 changed the title fix: resolve jbang deps search hang on Windows fix: resolve jbang deps search hang on Windows #2549 Jun 27, 2026
@@ -44,21 +44,22 @@
import java.util.stream.Collectors;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

these changes in NetUtil seems unrelated?

.build();
try (ToolkitRunner r = ToolkitRunner.builder().bindings(bindings).build()) {

dev.tamboui.tui.TuiConfig config = null;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

please don't use fully qualified classnames unless actually required.

Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
@maxandersen
maxandersen force-pushed the fix/windows-deps-search branch from 01c2649 to 760b956 Compare June 28, 2026 05:36
@maxandersen

Copy link
Copy Markdown
Collaborator

pushed fixes for the review - will merge when test passes

@maxandersen
maxandersen enabled auto-merge (squash) June 28, 2026 05:37
@arnabnandy7

Copy link
Copy Markdown
Contributor Author

pushed fixes for the review - will merge when test passes

@maxandersen thanks for the review and remedial.

@maxandersen
maxandersen disabled auto-merge June 28, 2026 07:03
@maxandersen
maxandersen merged commit e7c5867 into jbangdev:main Jun 28, 2026
30 checks passed
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.

jbang deps search do not work on Windows

2 participants