Skip to content

MuPDF pid #3093

@duelistone

Description

@duelistone

Description

I think commit 1a5de42 introduces a regression to mupdf updating after compilation.

The PID saved in a mupdf viewer's self.job is the one for the sh -c mupdf... process (see autoload/vimtex/jobs/jobs.vim line 11), not mupdf itself. On my system, I fixed the issue by instead calling sh -c "exec mupdf ..." (so that mupdf becomes its outer shell process, and hence has the correct PID). I don't know if this would break other features of VimTeX, though, so you may prefer to go back to the xdotools press r approach.

Forward and reverse search work fine regardless.

I'm on VimTeX 2.15 because of my vim version, but I didn't find any commits that would have fixed this since then.

Steps to reproduce

  1. On Linux, run vim -u minimal.vim minimal.tex with any minimal.tex that compiles and the minimal.vim below:

    set nocompatible
    filetype plugin on
    syntax enable
    let g:vimtex_view_method = 'mupdf'
    " Add relevant options and VimTeX configuration below.
  2. Start continuous compilation.

  3. Add more text to minimal.tex and save file.

Expected behavior

MuPDF shows minimal.pdf with updated text.

Actual behavior

MuPDF stays the same.

Do you use a latexmkrc file?

The issue persists with an empty .latexmkrc

VimtexInfo

(Some filenames simplified. The actual pid of the MuPDF instance is 957332, not the 957331 that vimtex claims below.)

System info:
  OS: Debian GNU/Linux 12 (bookworm)
  Vim version: VIM 9.0 (1-1378, 1499, 1532, 1848, 1858, 1873, 1969, 2142)
  Has clientserver: true
  Servername: undefined (vim started without --servername)

VimTeX project: minimal
  base: minimal.tex
  root: ~
  tex: ~/minimal.tex
  main parser: current file verified
  document class: minimal
  compiler: latexmk
    engine: -pdf
    options:
      -verbose
      -file-line-error
      -synctex=1
      -interaction=nonstopmode
    callback: 1
    continuous: 1
    executable: latexmk
    job: 
      jobid: process 957325 run
      output: /tmp/vHWpRsq/0
      cmd: max_print_line=2000 latexmk -verbose -file-line-error -synctex=1 -interaction=nonstopmode  -pdf -pvc -pvctimeout- -view=none -e '$compiling_cmd = ($compiling_cmd ? $compiling_cmd . " ; " : "") . "echo vimtex_compiler_callback_compiling"' -e '$success_cmd = ($success_cmd ? $success_cmd . " ; " : "") . "echo vimtex_compiler_callback_success"' -e '$failure_cmd = ($failure_cmd ? $failure_cmd . " ; " : "") . "echo vimtex_compiler_callback_failure"' 'minimal.tex'
      pid: 957325
  viewer: MuPDF
    xwin id: 16777475
    job: 
      pid: 957331
      cmd: mupdf '~/minimal.pdf'
    cmd_synctex_view: synctex view -i 5:2:'~/minimal.tex' -o '~/minimal.pdf' | grep -m1 'Page:' | sed 's/Page://' | tr -d '

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions