ImHex icon indicating copy to clipboard operation
ImHex copied to clipboard

[Bug] Confusing behaviour when ImHex is ran from a terminal

Open J0w03L opened this issue 2 years ago • 3 comments

Operating System

Linux

What's the issue you encountered?

If running from the terminal, attempting to open a file that does not exist will result in ImHex trying to open that file and failing to do so, resulting in a window that looks like this:

image

Reloading the file in ImHex just closes the file.

Additionally, if one was to try running ImHex with options passed, ImHex will treat those options as the name of the file it's supposed to be opening. Admittedly this part isn't necessarily a bug, but it is confusing behaviour none-the-less. If I run ImHex with the command imhex --version I'd expect ImHex to output it's version or at least tell me that the option was unrecognized, but instead ImHex opens a non-existent file named --version.

How can the issue be reproduced?

Assuming there is no file named non-existent.file, simply run the following in a terminal: imhex non-existent.file

ImHex Version

1.27.1 f435191

ImHex Build Type

  • [ ] Nightly or built from sources

Installation type

AUR on both imhex-git and imhex-bin

Additional context?

No response

J0w03L avatar Feb 23 '23 19:02 J0w03L

Hey @WerWolv, what do you think the correct behaviour should be, here ? Personally I think it should open a view like "Create new file" button, but with the filename instead of "Unsaved file" (vscode has this behaviour)

iTrooz avatar Mar 24 '23 12:03 iTrooz

As for options like --version or --help, well.. I think it should try to treat them ofc

iTrooz avatar Mar 24 '23 12:03 iTrooz

We are going to work on terminal arguments. This will require some work. design discussed in discord: https://discord.com/channels/789833418631675954/789833418631675957/1088951410806235146

iTrooz avatar Mar 25 '23 16:03 iTrooz