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

Correct command to open URL generated, but the page doesn't open #55

Open
alichtman opened this issue Jun 19, 2022 · 7 comments
Open

Correct command to open URL generated, but the page doesn't open #55

alichtman opened this issue Jun 19, 2022 · 7 comments

Comments

@alichtman
Copy link

alichtman commented Jun 19, 2022

When I trigger the plugin, I see

vim-gh-line executing: xdg-open https://github.com/alichtman/shallow-backup/blob/a5b36f3532f07c4fc577495a2d476f8e133456ff/README.md#L239

but the page never opens in Firefox. Running that command manually in a terminal does open the page.

Env

  • Ubuntu 22.04
  • NVIM v0.7.0-dev

nvim health check


coc: health#coc#check
========================================================================
  - OK: nvim version satisfied
  - OK: Environment check passed
  - OK: Javascript bundle build/index.js found
  - OK: Service started

jedi: health#jedi#check
========================================================================
## jedi

nvim: health#nvim#check
========================================================================
## Configuration
  - OK: no issues found

## Performance
  - OK: Build type: RelWithDebInfo

## Remote Plugins
  - OK: Up to date

## terminal
  - INFO: key_backspace (kbs) terminfo entry: key_backspace=\177
  - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~
  - INFO: $VTE_VERSION='6800'
  - INFO: $TERM_PROGRAM='tmux'
  - INFO: $COLORTERM='truecolor'

## tmux
  - OK: escape-time: 0
  - INFO: Checking stuff
  - OK: focus-events: on
  - INFO: $TERM: xterm-256color
  - ERROR: $TERM should be "screen-256color" or "tmux-256color" in tmux. Colors might look wrong.
    - ADVICE:
      - Set default-terminal in ~/.tmux.conf:
          set-option -g default-terminal "screen-256color"
      - https://github.com/neovim/neovim/wiki/FAQ
  - WARNING: Neither Tc nor RGB capability set. True colors are disabled. |'termguicolors'| won't work properly.
    - ADVICE:
      - Put this in your ~/.tmux.conf and replace XXX by your $TERM outside of tmux:
          set-option -sa terminal-overrides ',XXX:RGB'
      - For older tmux versions use this instead:
          set-option -ga terminal-overrides ',XXX:Tc'

provider: health#provider#check
========================================================================
## Clipboard (optional)
  - OK: Clipboard tool found: xclip

## Python 2 provider (optional)
  - INFO: pyenv: Path: /usr/local/var/pyenv/libexec/pyenv
  - INFO: pyenv: Root: /usr/local/var/pyenv
  - INFO: Using: g:python_host_prog = "/usr/bin/python2"
  - INFO: Executable: /usr/bin/python2
  - ERROR: Command error (job=7, exit code 1): `'/usr/bin/python2' -c 'import sys; sys.path = list(filter(lambda x: x != "", sys.path)); import neovim; print(neovim.__file__)'` (in '/home/alichtman/Desktop/Development/projects/shallow-backup')
    stderr: Traceback (most recent call last):  File "<string>", line 1, in <module>ImportError: No module named neovim
  - INFO: Python version: 2.7.18
  - INFO: pynvim version: unable to load neovim Python module
  - ERROR: pynvim is not installed.
    Error: unable to load neovim Python module
    - ADVICE:
      - Run in shell: /usr/bin/python2 -m pip install pynvim

## Python 3 provider (optional)
  - INFO: pyenv: Path: /usr/local/var/pyenv/libexec/pyenv
  - INFO: pyenv: Root: /usr/local/var/pyenv
  - INFO: Using: g:python3_host_prog = "/usr/local/var/pyenv/shims/python3"
  - INFO: Executable: /usr/local/var/pyenv/shims/python3
  - INFO: Python version: 3.8.1
  - INFO: pynvim version: 0.4.3
  - OK: Latest pynvim is installed.

## Python virtualenv
  - OK: no $VIRTUAL_ENV

## Ruby provider (optional)
  - INFO: Ruby: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux]
  - WARNING: `neovim-ruby-host` not found.
    - ADVICE:
      - Run `gem install neovim` to ensure the neovim RubyGem is installed.
      - Run `gem environment` to ensure the gem bin directory is in $PATH.
      - If you are using rvm/rbenv/chruby, try "rehashing".
      - See :help |g:ruby_host_prog| for non-standard gem installations.

## Node.js provider (optional)
  - INFO: Node.js: v18.3.0
  - WARNING: Missing "neovim" npm (or yarn) package.
    - ADVICE:
      - Run in shell: npm install -g neovim
      - Run in shell (if you use yarn): yarn global add neovim

## Perl provider (optional)
  - ERROR: perl provider error:
    - ADVICE:
      - "Neovim::Ext" cpan module is not installed

vim.lsp: require("vim.lsp.health").check()
========================================================================
  - INFO: LSP log level : WARN
  - INFO: Log path: /home/alichtman/.cache/nvim/lsp.log
  - INFO: Log size: 16 KB

vim.treesitter: require("vim.treesitter.health").check()
========================================================================
  - INFO: Runtime ABI version : 14
  - OK: Loaded parser for c: ABI version 13
@alichtman alichtman changed the title Correct command to open URL generated, but doesn't open from inside NVIM v0.7.0-dev Correct command to open URL generated, but the page doesn't open Jun 19, 2022
@zodman
Copy link

zodman commented Jul 5, 2022

same here!

I think its a neovim problem:

:call system('xdg-open http://firefox.com')

https://github.com/neovim/neovim/wiki/FAQ#-and-system-do-weird-things-with-interactive-processes

Im not neovim expert but should be other way to call xdg-open without system.

temporal solution, because I use a lot this plugin:
add the setting let g:gh_trace=1 to your vimrc then you will at least see the URL on the statusline

@zodman
Copy link

zodman commented Jul 26, 2022

@alichtman check prev message!

@alichtman
Copy link
Author

@zodman Yup, I agree with your analysis (and thumbs'd up your comment the day you posted it 😃)

Leaving the issue open, as there's no proper fix

@sebastian-palma
Copy link
Contributor

As mentioned here, you can use jobstart instead of system (works on Ubuntu 22.04, NVIM v0.9.0-dev-342+g282cbc235).

@zodman
Copy link

zodman commented May 17, 2023

@sebastian-palma PR please please!

@alichtman
Copy link
Author

alichtman commented May 17, 2023

I found out that vim-fugitive has this functionality baked in, so I added these two remappings and dropped the vim-gh-line plugin from my config.

" Open selection on github
nnoremap go :.GBrowse<CR>
vnoremap go :'<,'>.GBrowse<CR>

I think the proposed jobstart patch would fix this issue (and I would put up a PR if I hadn't already fixed my workflow).

@sebastian-palma
Copy link
Contributor

@zodman see this, this is the only change I needed to make it work.

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

No branches or pull requests

3 participants