Comments (12)
Looks like this is a regression.
$ hexyl
┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐
^C
$ hexyl --version
hexyl 0.3.0
$ brew upgrade hexyl
==> Upgrading 1 outdated package:
hexyl 0.3.0 -> 0.6.0
==> Upgrading hexyl
==> Downloading https://homebrew.bintray.com/bottles/hexyl-0.6.0.mojave.bottle.1.tar.gz
==> Downloading from https://akamai.bintray.com/99/99a3133f73538f29f0dc2a603f122b2c2165fdd53de0f2141fc0ebab086c22f2?__gda__=exp=1581631705~hmac=3d6116586601720ea23e57ef75b254d0f67b4fe494e7be2d3aeb175112ad9eb7&response-content-disposition=atta
######################################################################## 100.0%
==> Pouring hexyl-0.6.0.mojave.bottle.1.tar.gz
🍺 /usr/local/Cellar/hexyl/0.6.0: 5 files, 704.3KB
Removing: /usr/local/Cellar/hexyl/0.3.0... (5 files, 1.2MB)
==> Checking for dependents of upgraded formulae...
==> No dependents found!
$ hexyl
^C^C^C^C
from hexyl.
This affects me on Linux as well. Kernel 5.5.3 (Arch Linux), Hexyl 0.6.0.
from hexyl.
Looks like it was broken here 1903047. The handler gets called but the cancelled
never gets loaded if read
doesn't return (AFAICT).
from hexyl.
Not very good at reading Rust, but as far as I understand the logic flow that seems like a correct analysis.
from hexyl.
@twe4ked Yes, that is correct. The handler doesn't work because we are in the blocking read
call. This can easily be verified by pressing Ctrl-C
and then Enter
.
Simply reverting that commit would be an easy fix for this issue, but make the #35 situation worse. However, this bug here is much more relevant. #35 is a "cosmetic" thing only.
from hexyl.
libc::read
will return EINTR
when a signal handler was called. The read method for stdio and files in libstd loops until it doesn't return EINTR
anymore. Try using the raw libc::read
function.
from hexyl.
@bjorn3: Thank you!
It looks like setting SA_RESTART
in sigaction(3)
would also work?
I'm currently looking into the signal_hook
crate...
from hexyl.
No, I guess that wouldn't work. Unsetting SA_RESTART
would work if it wouldn't be caught explicitly.
from hexyl.
Any new status on this issue? I can perform testing on MacOS if that is needed.
from hexyl.
I did not find any solution with signal_hook
and I would like to refrain from using unsafe
features (callibg libc::read
directly).
I'm going to remove the signal handler completely, for now. This will fix this issue.
from hexyl.
fixed in v0.7.0
from hexyl.
Cool!
from hexyl.
Related Issues (20)
- Is there a cheat sheet anywhere telling what color correlates to category of byte? HOT 3
- Add support for the NO_COLOR environment variable HOT 4
- Regression: broken pipe error
- Make --panels=auto the new default? HOT 3
- hexyl should not fail if `--panels=auto` is used and output is not a TTY
- Identical lines not squeezed HOT 3
- hexyl -C does the inverse of hexdump -C HOT 1
- Request: publish source tar with generated manpage HOT 3
- Support for different code pages / character tables
- Incorrect output when reading from terminal HOT 2
- Feature request: Ship as a crate HOT 3
- `hexyl /dev/zero` hangs HOT 6
- Display some non-printable characters like `bat --show-all` HOT 5
- Feature request: Comodore prg mode HOT 1
- CI artifact names conflict HOT 2
- Provide Statically Compiled Binaries for (aarch64|arm64) Linux HOT 1
- Support raw output HOT 2
- Customize colors
- Completions for fish shell HOT 1
- is there a way to open disk devices in windows? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hexyl.