* Refactor fifo code and add explorer
* add explorer option and flag
* notify explorer fifo on selection
* close explorer fifo file descriptor
* Try to create explorer fifo if doesn't exist
This doesn't quite work
* Allow uncreated fifos
* delete persistence fifo on cleanup
with correct formatting
Co-authored-by: luukvbaal <31730729+luukvbaal@users.noreply.github.com>
* Work correctly with NOFIFO
* Refactor variable names
* fix
* Use -X flag for explorer mode
* Update manpage with explorer mode
Co-authored-by: luukvbaal <31730729+luukvbaal@users.noreply.github.com>
Plugins like fzopen have the capability to pick files.
This comes handy if nnn is executing as a file picker.
This is a 2-way communication:
- nnn sends the picker output file to plugin ("-" for stdout)
- the plugin tells nnn if it has overwritten the output file
If you have selected some files, you intend to work on them. Also, this prompt
expects <kbd>c</kbd> / <kbd>s</kbd> which should cancel the next prompt in the
delete workflow. Rest of the three workflows are non-fatal.
Benefits of removing this option:
- code reduction
- one less step in the relevant workflows (more than one prompt feels dragged)
This prompt shows in the following workflows:
- delete: users have explicitly requested to prefer sel over current
- batch rename: key <kbd>^R</kbd> renames a single file
- archive: in most of the cases the user would want to archive the selection
- create sym/hard link: not a frequently used workflow (in general)
If an input stream is available, prioritize that over sessions. find/grep
syntax can be very complex and can be scripted. On the contrary, sessions
can be loaded at runtime and the persistent session can be "restored".
An interesting use case is the listing is done in picker mode from a script
and the user expects to "pick" some entries among the listed search results.
Another important change is - if the user tries to load the "last session"
explicitly by name instead of using the session option _restore_, we should
not overwrite the "last session" ("@") before loading the it.
Without this, there is a conflict with using the `-u` option (use selection).
After copying selected files, the selection is intact and if the user issues
a deletion next, the source files (meant for copying) are deleted.
* Add -a option to generate a temporary NNN_FIFO
* Add documentation for -a option
* plugins/README.md: promote the use of -a
This obsoletes the global FIFO unlink trick, so I remove mentions of it.
@jarun update:
Polish -a
* Allow launching plugins with Alt + plugin's key
* Fix Alt key in filter/prompts modes
* Fix handling Alt key in nextsel()
In filter mode: run the associated plugin.
In prompt mode: just throw out the Alt+key input.
In nextsel(): differentiate Alt+key and Esc
* Add an option to print hovered files to a FIFO
This adds an env variable, `NNN_FIFO`, that can be set to a path that
`nnn` will open/create as a FIFO, and where every hovered file's path is
printed. This allows creating external perview/quick open plugins, ...
It can be compiled out with the make variable `O_NOFIFO`.
* Check filename ptr instead of full path (for FIFO)
* Add documentation to use NNN_FIFO in plugins
* Fix path sent to FIFO in empty dirs
* Add middle click copy
* Make middle click action configurable
This introduces the NNN_MIDDLECLICK environment variable, containing the
key that middle mouse click emulates. Only the first character is read.
* Document NNN_MIDDLECLICK in nnn.1
* Use NNN_MCLICK instead of NNN_MIDDLECLICK
* Add '^key' syntax to set middle click to Ctrl+Key