Skip to content

fix(plugin-qrcode): skip interactive loop in non-TTY environments (#2201)#2202

Merged
colinaaa merged 1 commit intolynx-family:mainfrom
knullptr:main
Feb 10, 2026
Merged

fix(plugin-qrcode): skip interactive loop in non-TTY environments (#2201)#2202
colinaaa merged 1 commit intolynx-family:mainfrom
knullptr:main

Conversation

@knullptr
Copy link
Copy Markdown
Contributor

@knullptr knullptr commented Feb 9, 2026

When stdin is not a TTY (CI, piped output, Docker without -it), the interactive shortcut menu is now skipped to prevent hangs, while still printing the QR code.

Summary by CodeRabbit

  • Bug Fixes

    • Plugin no longer blocks or prompts in non-interactive/automated environments; it skips the interactive loop to avoid hangs or unexpected prompts.
  • Chores

    • Added a patch release note marker documenting this behavior change for the QR code plugin.

Checklist

  • Tests updated (or not required). not required.
  • Documentation updated (or not required). not required.
  • Changeset added, and when a BREAKING CHANGE occurs, it needs to be clearly marked (or not required). not required.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Feb 9, 2026

🦋 Changeset detected

Latest commit: 4c19c08

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@lynx-js/qrcode-rsbuild-plugin Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@cla-assistant
Copy link
Copy Markdown

cla-assistant bot commented Feb 9, 2026

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 9, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Added an early-return guard in the QR code plugin's loop to detect non-interactive stdin (via process.stdin.isTTY and related properties) so the loop exits when stdin is unavailable; also added a changeset entry noting the behavior. No public API changes.

Changes

Cohort / File(s) Summary
QR Code Loop Guard
packages/rspeedy/plugin-qrcode/src/shortcuts.ts
Added an early-return guard in the loop function to skip execution when stdin is non-interactive (non-TTY).
Changeset / Release Note
.changeset/quiet-dogs-sleep.md
Added a patch changeset describing the non-TTY/interactive-loop behavior change for the QR code plugin.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested reviewers

  • colinaaa

Poem

🐰 I sniffed the stdin, quiet and spry,
If TTY's sleeping, I let the loop lie.
No prompts in the dark, I hop away light,
Safe little guard keeps the prompts polite. 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: fixing the qrcode plugin to skip interactive loops in non-TTY environments, which directly matches the code changes and PR objectives.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

@knullptr knullptr force-pushed the main branch 3 times, most recently from 60553b4 to 131b76d Compare February 9, 2026 06:42
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Feb 9, 2026

CodSpeed Performance Report

Merging this PR will degrade performance by 10.33%

Comparing knullptr:main (4c19c08) with main (82068ae)

Summary

⚡ 1 improved benchmark
❌ 1 regressed benchmark
✅ 61 untouched benchmarks
⏩ 3 skipped benchmarks1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
transform 1000 view elements 40.3 ms 44.9 ms -10.33%
basic-performance-nest-level-100 7.8 ms 6.9 ms +12.92%

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@relativeci
Copy link
Copy Markdown

relativeci bot commented Feb 9, 2026

Web Explorer

#7579 Bundle Size — 383.74KiB (0%).

4c19c08(current) vs a10b3ec main#7575(baseline)

Bundle metrics  no changes
                 Current
#7579
     Baseline
#7575
No change  Initial JS 154.88KiB 154.88KiB
No change  Initial CSS 35.06KiB 35.06KiB
No change  Cache Invalidation 0% 0%
No change  Chunks 8 8
No change  Assets 8 8
No change  Modules 238 238
No change  Duplicate Modules 16 16
No change  Duplicate Code 2.99% 2.99%
No change  Packages 4 4
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#7579
     Baseline
#7575
No change  JS 252.82KiB 252.82KiB
No change  Other 95.85KiB 95.85KiB
No change  CSS 35.06KiB 35.06KiB

Bundle analysis reportBranch knullptr:mainProject dashboard


Generated by RelativeCIDocumentationReport issue

…x-family#2201)

Add TTY check before starting keyboard shortcuts loop to prevent errors
in non-interactive environments such as CI/CD pipelines or piped commands.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@colinaaa colinaaa left a comment

Choose a reason for hiding this comment

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

Thank you!

@colinaaa colinaaa enabled auto-merge (squash) February 10, 2026 03:16
@colinaaa colinaaa merged commit 9f6c756 into lynx-family:main Feb 10, 2026
75 of 78 checks passed
colinaaa pushed a commit that referenced this pull request Feb 23, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @lynx-js/motion@0.0.3

### Patch Changes

- Fix an issue that motion/mini will accidentally imports full version,
causing compiling error
([#2204](#2204))

## @lynx-js/react@0.116.3

### Patch Changes

- fix: remove `lynx.createSelectorQuery` deprecated warning in
production
([#2195](#2195))

- Add a DEV-only guard that detects MainThread flush loops caused by
re-entrant MTS handlers.
([#2159](#2159))

This typically happens when a MainThread handler (e.g. event callback or
`MainThreadRef`) performs UI mutations (like `Element.setStyleProperty`,
`setStyleProperties`, `setAttribute`, or `invoke`) that synchronously
trigger a flush which re-enters the handler again.

- Avoid DEV_ONLY_SetSnapshotEntryName on standalone lazy bundle.
([#2184](#2184))

- Add alog and trace for BTS event handlers.
([#2102](#2102))

- fix: Main thread functions cannot access properties on `this` before
hydration completes.
([#2194](#2194))

    This fixes the `cannot convert to object` error.

- Remove element api calls alog by default, and only enable it when
`__ALOG_ELEMENT_API__` is defined to `true` or environment variable
`REACT_ALOG_ELEMENT_API` is set to `true`.
([#2192](#2192))

- fix: captured variables in main thread functions within class
components do not update correctly
([#2197](#2197))

## @lynx-js/rspeedy@0.13.4

### Patch Changes

- Bump ts-blank-space v0.7.0
([#2238](#2238))

- Bump Rsbuild v1.7.3 with Rspack v1.7.5.
([#2189](#2189))

-   Updated dependencies \[]:
    -   @lynx-js/web-rsbuild-server-middleware@0.19.8

## @lynx-js/qrcode-rsbuild-plugin@0.4.5

### Patch Changes

- Only register console shortcuts when running in TTY environments
([#2202](#2202))

## @lynx-js/react-rsbuild-plugin@0.12.8

### Patch Changes

- Updated dependencies
\[[`4240138`](4240138)]:
    -   @lynx-js/react-webpack-plugin@0.7.4
    -   @lynx-js/react-alias-rsbuild-plugin@0.12.8
    -   @lynx-js/use-sync-external-store@1.5.0
    -   @lynx-js/react-refresh-webpack-plugin@0.3.4
    -   @lynx-js/template-webpack-plugin@0.10.3

## @lynx-js/testing-environment@0.1.11

### Patch Changes

- Remove element api calls alog by default, and only enable it when
`__ALOG_ELEMENT_API__` is defined to `true` or environment variable
`REACT_ALOG_ELEMENT_API` is set to `true`.
([#2192](#2192))

## @lynx-js/web-constants@0.19.8

### Patch Changes

-   Updated dependencies \[]:
    -   @lynx-js/web-worker-rpc@0.19.8

## @lynx-js/web-core@0.19.8

### Patch Changes

- fix: avoid error when LynxView is removed immediately after connected
([#2182](#2182))

-   Updated dependencies \[]:
    -   @lynx-js/web-constants@0.19.8
    -   @lynx-js/web-mainthread-apis@0.19.8
    -   @lynx-js/web-worker-rpc@0.19.8
    -   @lynx-js/web-worker-runtime@0.19.8

## @lynx-js/web-core-wasm@0.0.3

### Patch Changes

- Updated dependencies
\[[`e0972ef`](e0972ef),
[`3bc017e`](3bc017e),
[`e2d349e`](e2d349e),
[`d924b6a`](d924b6a)]:
    -   @lynx-js/web-elements@0.11.2
    -   @lynx-js/web-worker-rpc@0.19.8

## @lynx-js/web-elements@0.11.2

### Patch Changes

- Add scrollHeight/scrollWidth getters to XList.
([#2156](#2156))

- Inherit padding styles for x-input elements.
([#2199](#2199))

- Remove the default lazy-loading attribute from x-image elements.
([#2186](#2186))

- Fix x-input number type forwarding to the inner input element.
([#2193](#2193))

## @lynx-js/web-mainthread-apis@0.19.8

### Patch Changes

-   Updated dependencies \[]:
    -   @lynx-js/web-constants@0.19.8

## @lynx-js/web-worker-runtime@0.19.8

### Patch Changes

-   Updated dependencies \[]:
    -   @lynx-js/web-constants@0.19.8
    -   @lynx-js/web-mainthread-apis@0.19.8
    -   @lynx-js/web-worker-rpc@0.19.8

## @lynx-js/react-webpack-plugin@0.7.4

### Patch Changes

- Remove element api calls alog by default, and only enable it when
`__ALOG_ELEMENT_API__` is defined to `true` or environment variable
`REACT_ALOG_ELEMENT_API` is set to `true`.
([#2192](#2192))

## create-rspeedy@0.13.4



## @lynx-js/react-alias-rsbuild-plugin@0.12.8



## upgrade-rspeedy@0.13.4



## @lynx-js/web-core-server@0.19.8



## @lynx-js/web-rsbuild-server-middleware@0.19.8



## @lynx-js/web-worker-rpc@0.19.8

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

3 participants