Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ToDo list #448

Closed
23 of 27 tasks
jarun opened this issue Jan 23, 2020 · 41 comments
Closed
23 of 27 tasks

ToDo list #448

jarun opened this issue Jan 23, 2020 · 41 comments

Comments

@jarun
Copy link
Owner

jarun commented Jan 23, 2020

Rolled from #386.

For next release

  • take list of files as input and show
  • option -e replaces NNN_USE_EDITOR
  • option -t replaces NNN_IDLE_TIMEOUT
  • PCRE support
  • more readline bindings for native prompts
  • run GUI app as plugin
  • attempt lazy unmount when regular unmount fails
  • fix unmount on macOS: use umount
  • detect sshfs and rclone to prompt intelligently
  • auto-proceed on file open (toggle key +)
  • quit with error code on Q
  • additional key F5 to toggle hidden
  • key e to edit in EDITOR (back on multiple user requests)
  • option to edit list of files in selection is changed to E
  • do not end selection on redraw
  • nuke: glow as Markdown viewer
  • nuke: refactor, handle some common video types by extension
  • file name removed from status bar
  • static Makefile target
  • generate, upload static package on release
  • fix crash on entering empty dir, then Down
  • fix keypresses lost when showing message
  • fix open file will generate defunct process #227: nnn creates xdg-open zombies

Proposed features and tasks (up for grabs)

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

List of completed features and tasks.

@jarun jarun mentioned this issue Jan 23, 2020
14 tasks
@tommyalatalo
Copy link

Is there any future possibility of having nnn as a completely standalone binary without dependenices? This would make it much easier to install using terminal plugin managers such as zinit etc.

@jarun
Copy link
Owner Author

jarun commented Jan 23, 2020

There are 2 options:

  • you can compile nnn statically without readline dep
  • remove the dependency on ncursesw (and libreadline): makes the code obfuscated with godforsaken color codes, term codes littered around. We won't do that. It's unmaintainable garbage.

@tommyalatalo
Copy link

There are 2 options:

* you can [compile `nnn` statically](https://github.com/jarun/nnn/wiki/Developer-guides#compile-statically) without readline dep

* remove the dependency on ncursesw (and libreadline): makes the code obfuscated with godforsaken color codes, term codes littered around. We won't do that. It's unmaintainable garbage.

Would you consider setting up a build and release for a statically compiled binary for your coming releases?
Installing those dependencies and setting up the build environment is too complex for sourcing in a shell environment, I would just want to be able to grab the binary from an archive, same way as fzf, rg and exa.

@jarun
Copy link
Owner Author

jarun commented Jan 23, 2020

@maximbaz I have pushed the static compilation flag at commit d67ad84.

Can you please update CircleCi to package a statically compiled nnn (64-bit only) on release?

You need to install libgpm-dev on Ubuntu and use the following command to compile nnn statically:

make O_STATIC=1 O_NORL=1 strip

@AN3223
Copy link
Contributor

AN3223 commented Jan 26, 2020

I'm writing my own opener and I feel it's awkward to tell nnn about my opener through an environment variable, and then tell nnn about my opener's behavior as a CLI option. Would it be possible for the -c (cli-only opener) option to be set as an environment variable in a future release? Or maybe have an environment variable that sets default CLI options (just like how less has the LESS variable)?

@jarun
Copy link
Owner Author

jarun commented Jan 26, 2020

Why do you specifically need an env var?

Why not use an alias n?

@AN3223
Copy link
Contributor

AN3223 commented Jan 26, 2020 via email

@jarun
Copy link
Owner Author

jarun commented Jan 26, 2020

An alias would only be usable by a shell.

If that's the concern, add a script in your PATH which calls nnn -c and name it n.

@jarun
Copy link
Owner Author

jarun commented Jan 26, 2020

The reason we want to reduce env vars is reading in env vars is much slower wrt. reading in an option. We want to keep the startup time blazing fast.

@AN3223
Copy link
Contributor

AN3223 commented Jan 26, 2020 via email

@jarun
Copy link
Owner Author

jarun commented Jan 27, 2020

In that case can't we hit two birds with one stone and replace some of the existing variables with CLI options, and then have an NNN variable for setting the default CLI flags?

There aren't any binary ones left (on master) other than NNN_TRASH.

The opener can be a CLI opener (which can spawn GUI apps too if you spawn GUI apps in the bg like nuke) one or a purely GUI one. By default, if no opener is specified we support xdg-open which behaves as a GUI opener in a DE.

The best we can do is - scrap -c and assume that if a custom opener is set, it is CLI-only (and that covers GUI too). I think the all-GUI opener is the unlikely case, because xdg-open already covers the case for you.

Adding @maximbaz for his inputs on this.

@jarun
Copy link
Owner Author

jarun commented Jan 27, 2020

I think the all-GUI opener is the unlikely case

I was wrong. Many users have mimeopen on *BSD.

@ahdyt
Copy link

ahdyt commented Jan 27, 2020

Sorry jarun, so how is the keybind? i feel stupid using nnn, can't move nor delete files:( all i had to do is check the folder/file with nnn and then exit nnn and do mv or cp or rm :'(

@maximbaz
Copy link
Contributor

I'll try to get to CircleCI this week, but if you have time, feel free to just do it 👍

Do you have some numbers, how much time is saved by removing environment variables? Just curious. I still feel a bit weird about making an exception for NNN_TRASH but nothing else, in my mind it should be either all or none 🙂

@maximbaz
Copy link
Contributor

One more random thought on why environment variables are convenient: I normally use n alias with all my favorite CLI flags, but when I test development version I run binary as ./nnn and it already happened to me twice that I was confused why behavior is unexpected, only realizing too late that ./nnn doesn't include all my flags from n alias 🙂

@jarun
Copy link
Owner Author

jarun commented Jan 28, 2020

@alfianguide all keybinds are fixed. Move to master. Did you read program docs?

See the program help using ?.

To move files:

  • use ^J to select or unselect
  • go to the destination directory
  • press ^V
  • if you want to copy the files instead, press ^P

To remove files: press ^X on the file followed by c. If you want to force remove without any question, press y.

Please read the docs. We spent a lot of time writing those. The para on selection is here - https://github.com/jarun/nnn/wiki#selection

Workflows in nnn may feel different from any other file manager you have used. So take your time. You'll save a lot of it in the long run.

@jarun
Copy link
Owner Author

jarun commented Jan 28, 2020

@maximbaz

I'll try to get to CircleCI this week, but if you have time, feel free to just do it

I tried, hit some issues. Do not have the bandwidth to experiment.

I still feel a bit weird about making an exception for NNN_TRASH but nothing else, in my mind it should be either all or none

I don't have numbers but I did see binary size decrease when I removed xgetenv. Also, try analytically - getenv scans a number of env variables by matching against the one you need. It's a flat list. Type export and you'll see how many are exported when you spawn a shell. The same is the case with getting username and groupname which is why I decoupled that in a plugin.

On the other hand, options are driven by what you use. If none, no matches performed.

NNN_TRASH is more about guarantee from accidentally deleting files.

only realizing too late that ./nnn doesn't include all my flags from n alias

Happens to me too. But only 4 or 5 people write and debug nnn.

@jarun
Copy link
Owner Author

jarun commented Jan 28, 2020

@AN3223 I have spent some quality time thinking about it and my decision is to stick to the current mechanism. Most people do not write their own openers and if you are capable of writing one, you have probably read the in-file nuke documentation. Just because of a personal perception I can't go ahead and change a documented design that works fine.

  • Options are faster than scanning env vars.
  • An additional option to enable/mask multiple env vars doesn't solve the problem, it adds to it with a cumbersome coupled design most newbies would never understand.
  • mimeopen is the default for many users and they shouldn't have to use -c.

The current design was the result of a discussion between @KlzXS @DinoPetrucci and me in issue #334. We can't move back and forth on trivia. It's final.

@lawnowner
Copy link
Contributor

Merging key bindings and removing file name from status bar are nice additions, thanks.

I ran into a strange problem yesterday: I tend to use the batch renaming functionality when I need to rename files in nnn, usually because I can't use vi-command key bindings of Readline at nnn's ^R prompt. I didn't have any problems with it so far (except when window size is set in .vimrc without checking for gui_running, it initially gives a waterfall effect as one scrolls down). However, when I used ^R to rename a file with a rather long name, nnn displayed only the first 128 characters of the file name, e.g. ^R on a file named "0..0128gone" displays "0..0128" at the nnn prompt, and when the '8' is deleted, no more characters can be entered either, although neither batch renaming inside nnn nor renaming with the mv command at shell prompt, inside or outside nnn, has any problems with renaming the same file from "0..0128gone" to "0..0128not gone".

@jarun
Copy link
Owner Author

jarun commented Jan 28, 2020

because I can't use vi-command key bindings of Readline at nnn's ^R prompt

More readline bindings are supported at the native prompt now with PR #452.

However, when I used ^R to rename a file with a rather long name, nnn displayed only the first 128 characters of the file name

Please confirm if it works with commit c434d8d.

@KlzXS
Copy link
Collaborator

KlzXS commented Jan 29, 2020

@jarun I just realized that ^S is bound to start a plugin. That's quite an unlucky bind as it is also the control sequence that locks terminal output, ^Q unlocks it.

@maximbaz
Copy link
Contributor

By the way, you can use ^S and ^Q if you run stty -ixon, unless of course you use this lock functionality

@KlzXS
Copy link
Collaborator

KlzXS commented Jan 29, 2020

I don't actually use it myself but that's great info, we should probably document it somewhere.

Also a semi-cool totally intended feature is that exiting with ^G emits a beep if used on a tty and the correct modules are loaded. Not true, ncurses is a thing.

@jarun
Copy link
Owner Author

jarun commented Jan 30, 2020

@gyvess
Copy link

gyvess commented Jan 30, 2020

I've been using nnn for a few weeks now and have a couple suggestions and comments. I hope this is the right thread to make them in.

  • All selected files should open when an open key is pressed

    • At the moment only the highlighted file is opened. If this is changed, make sure only the selected files are opened and the highlighted file is not included.
  • Add the option to run commands as plugins as GUI

    • Convenient to have the ability to launch programs in two stokes but the application taking over the terminal afterward is not useful to me. For example, prefix a vertical bar to launch the program as GUI. m:|-_mpv $nnn*
  • The case of keys in the help program help should change

    • i.e. ^U should be ^u. The former reads as CTRL+SHIFT+u though it is merely CTRL+u. This can be especially confusing when, within the same help text, q is quit singular context and Q is quit out of the entire program.
  • Selecting files, deselecting all files, then pressing p or v causes nnn to send a notification and redraw the terminal

    • Should print "0 Selected" as if you never selected anything at all
  • Command line argument to disable locking

    • On my keypad layout 0 and 1 are right next to eachother so I've accidentally locked the terminal more than once.
  • Maybe use font glyphs to further distinguish folders and file types

    • I know you want to keep nnn small but if it isn't too much trouble it might go a long way to get people afraid of CLI programs to switch to this one. Would make it look a tiny bit better too. NerdFonts is fairly popular and the webdevicons plugin form Vim managed to do this so I figured I'd suggest it.

Thanks for the program. I switched from nautilus and nnn is so so so much better.

@jarun
Copy link
Owner Author

jarun commented Jan 30, 2020

All selected files should open when an open key is pressed

Selected files can be of different types. Have a plugin that does this.

Add the option to run commands as plugins as GUI

Use a plugin which can launch an app in the background. nuke does this. launch does something similar.

The case of keys in the help program help should change

https://en.wikipedia.org/wiki/Control_key#Notation

Selecting files, deselecting all files, then pressing p or v causes nnn to send a notification and redraw the terminal

I tried this on master - select a file, deselect, go to another dir and press ^P. No noti and it shows 0 selected message.

Command line argument to disable locking

It's disabled by default. Do not set it. And in master it is in fact a program option - -t.

Maybe use font glyphs to further distinguish folders and file types

That's not the nnn way of doing things. It doesn't take long to type \.mkv to list mkv files. And in the earlier versions we also have support to sort files by extension.

it might go a long way to get people afraid of CLI programs

People are no more afraid of CLI programs. They miss every convenience in GUI apps and do not bother about the time that's saved.

From what I have learnt there will always be users whose use case is browsing images in the terminal (using third-party utilities which need the caller program to pass the image dimensions to them) and renaming them. Nothing wrong about it, nnn now supports this use case too and more elegantly so using the capabilities of sxiv. What I am getting at is - there's no limit to how much convenience one asks for. So strategically I have decided to keep nnn useful for serious users - those who think fast, want to get work done faster, those who can lookup their files by filtering out and thank God rendering doesn't take a few microseconds of their lives every time a screen refresh happens.

Now that cannot be everyone's cup of tea. And I am fine with that. There are so many other nice utilities out there. End users should pick the one that suits their workflows and be happy.

@jarun
Copy link
Owner Author

jarun commented Jan 30, 2020

A personal story - I know successful engineer colleagues (no joke till this part, they are good) who are eagerly looking forward to move over to Linux for the past few years but cannot do so because they may not be able to watch movies in it or their wives may not be able to use it.

I would like nnn users to ask me if they can't find a file easily and when I tell them the way out, try a few regex expressions by hand or use the fuzzy search plugin. If they can't, this tool doesn't suit their needs.

@jarun
Copy link
Owner Author

jarun commented Jan 30, 2020

Add the option to run commands as plugins as GUI

I think we can have the | option, it's convenient. Can you raise a PR please?

@gyvess
Copy link

gyvess commented Jan 30, 2020

Selected files can be of different types. Have a plugin that does this.

True, I hadn't considered this as I only do this when attempting to open multiple of buffers in nvim.

Use a plugin which can launch an app in the background. nuke does this. launch does something similar.

I've been using nuke but a problem comes around when you want to use the same file in two separate programs. For exmaple, .m3u playlist files can be changed within a text editor for convenience and then launche with mpv afterward. Using nuke, .m3u files open with nvimby default so to open them in mpv it was cumbersome to press o, then type mpv, press enter, and finally press g to launch as gui. I'll try 'launch' though is I hadn't considered it.

I tried this on master - select a file, deselect, go to another dir and press ^P.

I see what it is now. Pressing m twice and then pressing p or v is what causes this.

It's disabled by default. Do not set it. And in master it is in fact a program option - -t.

The only options I have set are -Qxs, but I did install nnn from my package manager so maybe I'll have to try from source. That does remind me though, when using -Q on a previously created session I would still be nagged with the quit confirmation message. I had to create a brand new session for -Q to apply. Is that expected behavior? I just created a new session to see if it would lock and it did. This is version 2.9 so maybe something is weird with this package.

What I am getting at is - there's no limit to how much convenience one asks for. So strategically I have decided to keep nnn useful for serious users

Understood and well said. From where I'm sitting this ethos has served this program well, because nnn really makes me wonder how I ever tolerated navigation in all the GUI file managers I've been using my entire life.

I think we can have the | option, it's convenient. Can you raise a PR please?

Should I? I'm not a coder and have always looked at PRs as something for people far more capable than myself.

@jarun
Copy link
Owner Author

jarun commented Jan 30, 2020

I was suggesting to have a plugin like nuke, not nuke itself. You'll have an additional keybind anyway. I will check the | thing.

Session stores config. -Q was added recently.

@aryadovoy
Copy link

Hello, I have next options in .bashrc:

export NNN_USE_EDITOR=1
export VISUAL='nvim'
export EDITOR='nvim'
export PAGER='less'
export TERMINAL='st'

But after update to 2.9 I cannot use e and p keys. How can I edit by e and view by p?
Thanks.

@jarun jarun closed this as completed Jan 30, 2020
@jarun
Copy link
Owner Author

jarun commented Jan 30, 2020

e and p are gone. Please view plugin docs or man page to see how to bind editor and pager. You'll have to run those commands as plugins.

@jarun jarun reopened this Jan 30, 2020
@jarun
Copy link
Owner Author

jarun commented Jan 30, 2020

@gyvess run GUI app as plugin is implemented at commit 6aed714.

@0xACE
Copy link
Collaborator

0xACE commented Jan 30, 2020

@aryadovoy

#446 (comment) # but really I'd suggest you provide a editor and pager script, as maintaining that patch isn't going to be fun unless you intend to keep up with nnns development.

Edit: spelling

@aryadovoy
Copy link

aryadovoy commented Jan 31, 2020

e and p are gone. Please view plugin docs or man page to see how to bind editor and pager. You'll have to run those commands as plugins.

Ok, thanks!
And change info on wiki page: from NNN_CONTEXT_COLORS to NNN_COLORS.

How about adding owner info to detail view? And how can I view photo on right side of terminal? Now I use sxiv and plugin imgview, but it opens in new window and waiting, when I close.
And where are du- and au-mode?

@jarun
Copy link
Owner Author

jarun commented Jan 31, 2020

And change info on wiki page: from NNN_CONTEXT_COLORS to NNN_COLORS

Updated. Thanks!

How about adding owner info to detail view

Adding the calls to view owner name and group increases the memory usage of the program heavily (because they lead to parsing of owner and group info files in the system). To quickly see these info use the plugin uidgid.

And how can I view photo on right side of terminal?

You can't with nnn. Read the last part of #448 (comment).

And where are du- and au-mode?

Press t or ^T.

@alosich
Copy link

alosich commented Feb 10, 2020

@jarun thanks for your work, I find the nnn idea very interesting.

A question: why cp and mv operations are embededd in the nnn itself? Can't they be expressed via plugins, taking into account that selection is acessible for plugins? This would make it much more flexible, for example instead of calling cp and mv in place, such plugin would be able to dispatch copying to some kind of file transfer daemon, freeing the instance of nnn quickly without need to wait for transfer operation to end.

@jarun
Copy link
Owner Author

jarun commented Feb 10, 2020

@alosich That's because cp and mv are omnipresent and the operations are tightly coupled to the concept of a file manager. You are still free to have your own plugin(s) to do these.

@jarun
Copy link
Owner Author

jarun commented Feb 10, 2020

In fact, if you implement these plugins please contribute back. ;c and ;m would be excellent bindings.

@alosich
Copy link

alosich commented Feb 10, 2020

@jarun

In fact, if you implement these plugins please contribute back. ;c and ;m would be excellent bindings.

I need to implement file transfer daemon to start with, heh. But if I get to this I will.

@jarun
Copy link
Owner Author

jarun commented Feb 10, 2020

See if rsync can be done in the background.

@jarun jarun closed this as completed Feb 12, 2020
Repository owner locked as resolved and limited conversation to collaborators Feb 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests