vifm / vifm

Vifm is a file manager with curses interface, which provides Vim-like environment for managing objects within file systems, extended with some useful ideas from mutt.
https://vifm.info
GNU General Public License v2.0
2.75k stars 125 forks source link

Proposal: make dialog behavior more CLI-like #433

Open cdlscpmv opened 5 years ago

cdlscpmv commented 5 years ago

Right now vifm in many circumstances behaves like a TUI application with an attempt to emulate GUI (pop-up dialogs, for example). If we look at Vim instead then we see that it behaves more like a CLI application in such cases. If it wants to show a message, it displays it directly on the command line (in the ruler). If it needs some confirmation from the user, it presents a simple prompt there as well. Vifm is not far from that but it displays those things in the form of a dialog window. In my opinion the CLI form is more consistent with command-line applications in general.

@xaizek, I would like to know you thoughts on that.

xaizek commented 5 years ago

I actually have an old branch (almost exactly 8 years old) with error dialog displayed on command-line and I think the idea was to make it more Vim-like. I might have left it as is because message on a command-line doesn't draw as much attention as a dialog that appears in the middle of the screen, but I'm not sure by now.

Form of confirmation dialogs is configurable in gVim and since there is 'tuioptions' it could be configurable in vifm, although it might be somewhat weird for output of background jobs, which would suddenly appear at the bottom and hide what was there before.

By the way, there is a logic behind showing some messages on status bar and some as dialogs. Status bar messages are either informational or are a result of using the status bar to enter the command. Dialogs display results of key bindings, background operations and other kinds of unexpected errors.

cdlscpmv commented 5 years ago

a command-line doesn't draw as much attention as a dialog that appears in the middle of the screen

Sometimes they draw too much attention. For example, if I try to assemble a custom view with an external command and the %IU macro, I often times simply dismiss the command without making any choice. Vifm will present a dialog saying "Ignoring empty list of files" and asks me to press Enter. If there was a similar messages on the command line, there would be no need to press anything, and it would be less intrusive.

To draw user's attention Vim uses WarningMsg and ErrorMsg highlight groups for status messages (and honestly, I find this enough). Vifm lacks the former, but I think it can help in certain cases, when messages are meant to be non-intrusive (as with the case described above).

although it might be somewhat weird for output of background jobs, which would suddenly appear at the bottom and hide what was there before

I think it's no surprise for the user to see this happening (although I would advise against excessive use of asynchronous jobs; this is not the only issue they present). Moreover, there is the :messages command which will show things which he might have missed. If there are multiple messages to be shown at the same time then the "hit-Enter" prompt from Vim is fine.

By the way, there is a logic behind showing some messages on status bar and some as dialogs. Status bar messages are either informational or are a result of using the status bar to enter the command. Dialogs display results of key bindings, background operations and other kinds of unexpected errors.

I see your point. But all of the above applies to Vim as well. I make error messages bold enough, and I don't usually miss them. But the workflow is somewhat more smooth since I don't have to act on trivial messages.

I raise this issue not because of compatibility with Vim, but because I think that this way of messaging is more aligned with the rest of command-line applications, whereas dialogs are an attempt to emulate GUI (which is not perfect because of the limitations of the terminal). It is, of course, up to you to determine the future direction of vifm. I'm just providing a feedback, which, I hope, may be of some use.