Welcome to Vifm Q&A, where you can ask questions about Vifm usage. Registration is optional, anonymous posts are moderated. GitHub or Google logins are enabled.

Bash shows the last command as the first line in the editor

0 votes
asked Feb 14 in vifm by aleksejrs

Vifm Version: 0.10
Git info: built out of repository

Debian testing.

  1. In Vifm, open the shell.
  2. Press Ctrl-X, Ctrl-E to edit the command in Vim.

Earlier, the first line in the editor was blank; the last command executed was the second line.
After a change in Bash (Debian testing), the last command executed is the first line.

How do I revert the change?

commented Feb 14 by xaizek

Are you saying that vifm affects command-line editing in bash or you provided incorrect steps? vifm shows list of previous commands, but bash doesn't for me, so I'm somewhat confused so far. Just in case, the first line of the editor invoked by vifm is the contents of the command-line.

commented Feb 15 by aleksejrs

Sorry, I didn't check anything before posted that.

I guess Vifm does not affect this, although I might have edited a Bash configuration script according to a Vifm manual that might have affected it.

There is always only one line.

If, after the last call of the shell from Vifm, I returned to Vifm using "exit", next time I open the editor from Vifm, the only line is "exit".
If I just executed anything and didn't exit to Vifm, that will be the only line.
If I open the editor not from Vifm, but after exiting Vifm, the only line is "vifm".

commented Feb 15 by xaizek

Still have hard time wrapping my head around it. With which command do you "open the editor from Vifm"? Ctrl-G on command-line? Is it something like the following?
1. $ vifm
2. :shell
3. exit
4. :<c-g>

commented Feb 15 by aleksejrs
edited Feb 15 by aleksejrs

I open the shell from Vifm, which seems to call this default code in vifmrc:

" Start shell in current directory
nnoremap s :shell<cr>

Then I open the editor from the shell using Ctrl-X Ctrl-E.

It's not Vifm's fault that the shell opens the last command in the first line, but I didn't think of it before.

commented Feb 15 by xaizek

OK, so it's probably not something that Vifm does.

What you describe (insertion of the last command) is actually a behaviour of fc builtin. Maybe Ctrl-XCtrl-E got bound to it somehow.

Also, since having exit in command history isn't very useful, you can exclude it.

Your answer


Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
Please answer the question:
To avoid this verification in future, please log in or register.
If you would like to make a bug report or feature request consider using GitHub, SourceForge or e-mail. Posting such things here is acceptable, but this is not a perfect place for them.