Repository navigation
Conversation
Ian729
force-pushed
the
support-qr-code
branch
from
October 12, 2026 09:29
48e67f7 to
383c6ec
Compare
- Add `--qr` CLI flag to print an ASCII/ANSI QR code for the session link - Add `--qr-write` flag to print QR code for the writable link when `--enable-readers` is active - Use Unicode half-block characters (`Dense1x2`) for a compact representation (<20 lines) that fits standard terminals - Use explicit black-on-white ANSI styling for maximum contrast across dark and light terminal color themes - Add unit tests for QR rendering in `crates/sshx/src/qr.rs`
Ian729
force-pushed
the
support-qr-code
branch
from
October 12, 2026 09:35
383c6ec to
2788758
Compare
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #158.
This PR adds an optional
--qrCLI flag tosshxthat renders an ASCII/ANSI QR code for the session link directly in the terminal output.Motivation
sshxon a remote server, cloud instance, or Raspberry Pi via SSH, copying the long URL containing the high-entropy encryption key to a mobile device is cumbersome without shared clipboards.Implementation Details
qrcodecrate withdefault-features = falseto avoid pulling in the heavyimagecrate (and image decoders/encoders). Keeps compile times fast and binary size small without introducing any non-Rust C dependencies.Dense1x2(half-block characters▀and▄) to pack two vertical pixels per character line. This keeps the height under 20 lines (typically 19 lines tall for standard session URLs), ensuring the QR code fits cleanly within standard 80x24 terminal windows without wrapping or truncation.Whiteforeground onBlackbackground to ensure the QR code has a solid white quiet zone and black modules regardless of whether the user is running a dark, light, or custom terminal theme.--enable-readersis active,--qrdefaults to rendering the Read-only link for security against accidental write-access exposure.--qr-writeflag is provided to render the writable link's QR code when needed.-q / --quietmode, QR code output is suppressed, preserving script pipeability (URL=$(sshx -q)).Verification
crates/sshx/src/qr.rstesting standard, long, and read/write URLs.cargo test --workspace) and clippy (cargo clippy -p sshx --all-targets).cargo fmtadhering torustfmt.toml.sshx-serververifying phone scanner compatibility.