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

Can't use gnome-terminal as a default terminal #2

Open
omrihar opened this issue Sep 22, 2015 · 2 comments
Open

Can't use gnome-terminal as a default terminal #2

omrihar opened this issue Sep 22, 2015 · 2 comments
Assignees
Labels

Comments

@omrihar
Copy link

omrihar commented Sep 22, 2015

I have tried setting g:vifm_term to gnome-terminal -e but I keep getting the error Got non-zero code from vifm.
I think the problem is in https://github.com/vifm/vifm.vim/blob/master/plugin/vifm.vim#L128 since gnome-terminal expects to have quotes surrounding the command (I guess). I tried adding quotes, which got me half-way. Vifm opened in gnome-terminal but I immediately got the Failed to read list of files error and nothing happened when I tried to open a file.

The code I tried (which didn't work but sort-of opened vifm in gnome-terminal) is:

execute 'silent !' g:vifm_term '"' g:vifm_exec g:vifm_exec_args ldir rdir
\ pickargsstr '"'

Am I missing something? If you can get it to work by simply setting some other gnome-terminal option (instead of -e) please let me know.

@xaizek
Copy link
Member

xaizek commented Sep 22, 2015

You shouldn't need quotes if you use -x option, which takes the rest of command-line as a command (according to this).

The second issue you faced is that terminal detaches/forks from its parent leaving it without a way to track child's lifetime (hence the plugin reads output file right away, when it doesn't exist). Try adding --disable-factory option, like this:

let g:vifm_term = 'gnome-terminal --disable-factory -x'

If it doesn't work, I'm not sure how to proceed (by the way, looks like it worked years ago). I don't have GNOME and can't check it myself.

UPD (2016.01.16): yeah, they broke it intentionally and are not going to fix, see. Not sure how to synchronize plugin with vifm then and honestly I don't think it's worth it (I mean working around strange decisions of those people). The best advice I can give is do not use gnome-terminal. Who knows what else they will break next... That said, ideas are welcome, I just can't think of a feasible solution for this case.
UPD (2016.11.06): maybe creating a named pipe and reading from it until EOF will work as a workaround (didn't try it).

@xaizek xaizek self-assigned this Sep 22, 2015
@omrihar
Copy link
Author

omrihar commented Sep 30, 2015

Hi @xaizek, thanks for your reply!

I tried using the command you suggested. When I use the -x option, vifm opens but I immediately face the second issue. If I try to use --disable-factory in conjunction with -x, however, it fails again with the original error message (Got non zero exit code from vifm).

In the meantime I installed xterm and configured it to be more or less as I like it so it's not very pressing for me, but I think that for the rest of the community this might be relevant since when installing gnome-shell you by default only get gnome-terminal. (I'm running on Arch linux).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants