jarun / nnn

n³ The unorthodox terminal file manager
BSD 2-Clause "Simplified" License
19.12k stars 760 forks source link

ToDo list #506

Closed jarun closed 4 years ago

jarun commented 4 years ago

Rolled from #483.

Ready for next release

Proposed features and tasks (up for grabs)

Anything else which would add value (please discuss in this thread).

0xACE commented 4 years ago

https://github.com/jarun/nnn/blob/master/src/nnn.c#L3520-L3528

I guess this is the format you are looking for.

jarun commented 4 years ago

@joshaw At present if you pass a file path to nnn it would just open that file and exit.

I've pushed a sample implementation at commit 56886922a62b39b43897988bdae289a47fc1026a to select the file if the file path is passed.

@0xACE We do not need to modify session handling for this. When a session is saved it will store the path and hovered file correctly which works as it should.

The commit above breaks our current behaviour where we open the file directly using opener if the path points to a file and nnn exits. However, now nnn will stay open with the file hovered.

@0xACE @KlzXS @leovilok do you guys think this new behaviour is acceptable? Consider the scenario where a file is opened from the browser and nnn is set as the default file manager.

0xACE commented 4 years ago

I think it makes sense if nnn highlights the file if it has been given one in the path...

leovilok commented 4 years ago

I like this new behaviour better. I think that it's out of the scope of nnn to open the file directly.

jarun commented 4 years ago

OK. Then it stays!

joshaw commented 4 years ago

I've pushed a sample implementation at commit 5688692 to select the file if the file path is passed.

This works brilliantly. Thanks very much