voldikss / vim-floaterm

:computer: Terminal manager for (neo)vim
MIT License
2.5k stars 80 forks source link

Request to show message that "terminal" is required in vim #332

Closed miken700 closed 2 years ago

miken700 commented 2 years ago

Before reporting

Environment

If you are using vim(not neovim), fill in the following blanks

If you are using neovim, just run :checkhealth floaterm and post the content

below.

Configurations related to vim-floaterm in vimrc(i.e. g:floaterm_xxx):

Describe your question, feature request, or bug.

Request to show message that "terminal" is required in vim. Today when I open a window when terminal is not compiled into vim, the error message just says [vim-floaterm] Failed to execute: /bin/bash. But really this exception is because start_term is not defined. Would be nice to detect that terminal is not enabled and report that. Right now, I detect this at startup in my .vimrc as a workaround.

if !has('terminal')
    echohl ErrorMsg
    echom('[~/.vimrc] floaterm requires vim to be compiled with "terminal"')
    echohl None
endif

Note that terminal is not enabled by default in my distro (gentoo).

Also it might be nice to echo the v:exception in the error message to help with general problems around invoking the command. When I was troubleshooting this, I had added that to the error message in order to figure out what the problem was.

Steps to reproduce

Using the minimal vimrc

set nocompatible
set hidden
set termguicolors
set runtimepath^=/path/to/vim-floaterm
filetype plugin indent on
syntax on

Steps to reproduce the behavior:

Actual behaviour

Run vim without 'terminal' enabled. Get message unable to execute /bin/bash when running :FloatermNew

Expected behaviour

Show more helpful error message indicating that 'terminal' is required.

Screenshots(Optional, GIF is better)

adigitoleo commented 2 years ago

Can you confirm that the linked PR solves this?