oni icon indicating copy to clipboard operation
oni copied to clipboard

Oni wont't open when passed a number as first parameter

Open Gahen opened this issue 8 years ago • 3 comments

Oni Version: 0.3.6 Operating System: macOS Sierra

Issue: Running oni from the command line with a number as first parameter won't open the editor

Expected behavior: I should see the filesystem tool and the editor area

Actual behavior: I only see the system menu bar and the window UX

Steps to reproduce: open a terminal; run oni 123

Maybe this is only happening to me? I would be available to follow any debug step needed.

This is what I get:

screen shot 2018-09-26 at 11 42 05 am

Gahen avatar Sep 26 '18 18:09 Gahen

Hello and welcome to the Oni repository! Thanks for opening your first issue here. To help us out, please make sure to include as much detail as possible - including screenshots and logs, if possible.

oni-bot avatar Sep 26 '18 18:09 oni-bot

Hey, sorry for the slow reply!

This looks to be that the path checking logic we have fails in some fashion for just numbers:

image

I think this is type of the input being swapped to an int when just numbers are passed. Any other string seems to work (123.txt etc). The fix here should just be to force it always to a string, as well as not crashing if there is an error there.

The lines in question are these:

https://github.com/onivim/oni/blob/e3f65e694828f025186e3672f62d23a92f07833a/browser/src/App.ts#L110-L112

We can either swap the type just in there, or just update minimist to always treat everything as a string (except stuff like the debug flag etc).

I'll tag this as a good first issue since it seems easy enough, though we should try and get this sorted before the next release.

CrossR avatar Sep 27 '18 17:09 CrossR

Awesome! Thanks for giving it a look.

Gahen avatar Sep 27 '18 19:09 Gahen