Skip to content

Moved hot key handling and clipboard impl to crossterm. #95

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

Jisu-Woniu
Copy link
Contributor

Closes #94.

However, this brings more dependencies and is expected to longer compilation time.

The buggy read_key impl in console will keep the terminal in raw mode, where subsequent commands in shell won't see echo.

What's more, Ctrl+C used by tokio is tricky on Windows, so I am not aware how to trigger that correctly in new clipboard handling block.

In raw mode, the cursor won't go back to line beginning when '\n' is
printed. A '\r' would mannually reset the error message.
@n0bot n0bot bot added this to iroh Jul 12, 2025
@github-project-automation github-project-automation bot moved this to 🏗 In progress in iroh Jul 12, 2025
@Jisu-Woniu
Copy link
Contributor Author

Jisu-Woniu commented Jul 12, 2025

I need someone with Windows device to test whether Ctrl+C will quit the default compiled program, thanks!

You need to:

  • Install the version compiled from my fork
    # On a windows device: (need --force if sendme is already in .cargo/bin)
    cargo install --git https://github.com/Jisu-Woniu/sendme.git
  • Run sendme send <SOME-RANDOM-FILE>
  • After the program says press c to copy command to clipboard ..., press Ctrl+C.
  • Ensure the program exit correctly, and the terminal behaves correctly when running echo Hello or something like that.
  • If anything went wrong during that, notice me

@Jisu-Woniu Jisu-Woniu marked this pull request as ready for review July 12, 2025 06:08
> If the function succeeds, the return value is nonzero.
@Jisu-Woniu
Copy link
Contributor Author

Having tested it on my friend's Windows 10 PC with Windows Terminal. The above process works as expected.

Copy link

@robertkirkman robertkirkman left a comment

Choose a reason for hiding this comment

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

I have tested building and running this PR for Termux (Android) and I can confirm that it also prevents the problem of terminal output breaking after pushing Ctrl + C to stop sending on Termux.

@rklaehn
Copy link
Collaborator

rklaehn commented Jul 14, 2025

So how do I reproduce this with the original sendme? Run it on windows and then hit control-c? Ah, never mind. It is in the issue.

@Jisu-Woniu
Copy link
Contributor Author

Windows may or may not be affected by the original issue, I just want to check if the PR works on Windows. Never mind, I have tested it on my friend's Windows 10 PC.

Copy link
Contributor

@dignifiedquire dignifiedquire left a comment

Choose a reason for hiding this comment

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

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏗 In progress
Development

Successfully merging this pull request may close these issues.

Pushing Ctrl + C after running sendme send example_file.c results in terminal output breaking
4 participants