Why vimdiff <() <() reset when terminal is switched?

30 views
Skip to first unread message

Peng Yu

unread,
Apr 13, 2021, 10:39:56 AM4/13/21
to vim_use
When I call `vimdiff <(seq 3) <(seq 4)`, then switch to another terminal then switch back, the content in vim disappear. How to make the content persistent? Thanks.

$ vimdiff --version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Apr  1 2021 08:37:51)
macOS version - x86_64
Included patches: 1-2681
Compiled by GitHub Actions
Huge version with MacVim GUI.  Features included (+) or not (-):
+acl               +file_in_path      -mouse_sysmouse    -tag_old_static
+arabic            +find_in_path      +mouse_urxvt       -tag_any_white
+autocmd           +float             +mouse_xterm       -tcl
+autochdir         +folding           +multi_byte        +termguicolors
-autoservername    -footer            +multi_lang        +terminal
+balloon_eval      +fork()            -mzscheme          +terminfo
+balloon_eval_term +fullscreen        +netbeans_intg     +termresponse
+browse            +gettext           +num64             +textobjects
++builtin_terms    -hangul_input      +odbeditor         +textprop
+byte_offset       +iconv             +packages          +timers
+channel           +insert_expand     +path_extra        +title
+cindent           +ipv6              +perl/dyn          +toolbar
+clientserver      +job               +persistent_undo   +transparency
+clipboard         +jumplist          +popupwin          +user_commands
+cmdline_compl     +keymap            +postscript        +vartabs
+cmdline_hist      +lambda            +printer           +vertsplit
+cmdline_info      +langmap           +profile           +virtualedit
+comments          +libcall           +python/dyn        +visual
+conceal           +linebreak         +python3/dyn       +visualextra
+cryptv            +lispindent        +quickfix          +viminfo
+cscope            +listcmds          +reltime           +vreplace
+cursorbind        +localmap          +rightleft         +wildignore
+cursorshape       +lua/dyn           +ruby/dyn          +wildmenu
+dialog_con_gui    +menu              +scrollbind        +windows
+diff              +mksession         +signs             +writebackup
+digraphs          +modify_fname      +smartindent       -X11
+dnd               +mouse             -sound             -xfontset
-ebcdic            +mouseshape        +spell             +xim
+emacs_tags        +mouse_dec         +startuptime       -xpm
+eval              -mouse_gpm         +statusline        -xsmp
+ex_extra          -mouse_jsbterm     -sun_workshop      -xterm_clipboard
+extra_search      +mouse_netterm     +syntax            -xterm_save
-farsi             +mouse_sgr         +tag_binary
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/Applications/MacVim.app/Contents/Resources/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe -DMACOS_X -DMACOS_X_DARWIN -g -O2 -arch x86_64 -arch arm64 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -Wall -Wextra -Wshadow -Werror -Wno-error=missing-field-initializers -Wno-error=deprecated-declarations -Wno-error=unused-function
Linking: clang -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl@1.1/lib -L/usr/local/opt/readline/lib -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl@1.1/lib -L/usr/local/opt/readline/lib -arch x86_64 -arch arm64 -L/usr/local/lib -o Vim -lm -lncurses -liconv /usr/local/lib/libintl.a -framework AppKit -fstack-protector -L/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE

C. Meissa

unread,
Apr 13, 2021, 10:46:52 AM4/13/21
to vim...@googlegroups.com
Hi Peng Yu,

those pipes are not seek-able files and may not be read again — maybe this is.
Also, this problem sounds very very similar the your previous one.

Best Regards,
CM
> --
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/1564e276-39b5-4f27-828e-f4544504fedan%40googlegroups.com.

Gary Johnson

unread,
Apr 13, 2021, 11:28:46 AM4/13/21
to vim_use
On 2021-04-13, Peng Yu wrote:
> When I call `vimdiff <(seq 3) <(seq 4)`, then switch to another terminal then
> switch back, the content in vim disappear. How to make the content persistent?

I run vimdiff with process substitution like that all the time
without losing anything. The outputs of those seq commands exist
only in Vim buffers; you can't abandon those buffers and expect
to recover them. If you want to use Vim to look at something else,
just don't close the windows containing those buffers.

I don't understand what you mean by "switch to another terminal".

Regards,
Gary

Peng Yu

unread,
Apr 13, 2021, 2:39:43 PM4/13/21
to vim_use
I don't understand what you mean by "switch to another terminal".

On macOS, I use iTerm2 to run vimdiff <(seq 3) <(seq 4). Then open a new tab in iTerm2. Then go back to the original tab. Then the content in vimdiff disappears.

Bram Moolenaar

unread,
Apr 13, 2021, 2:55:01 PM4/13/21
to vim...@googlegroups.com, Gary Johnson
Maybe the 'hidden' option is useful?

--
I AM THANKFUL...
...for the piles of laundry and ironing because it means I
have plenty of clothes to wear.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Gary Johnson

unread,
Apr 13, 2021, 4:39:03 PM4/13/21
to vim_use
On 2021-04-13, Peng Yu wrote:
>
Thanks for the explanation. That is weird. I don't know why or how
the terminal in which Vim is running would affect buffer contents.
It may be something specific to Macs.

Regards,
Gary

Tony Mechelynck

unread,
Apr 13, 2021, 4:45:48 PM4/13/21
to vim_use
Does the vimdiff content reappear if you hit Ctrl-L (on a Mac it might
or might not be Cmd-L, I'm not sure) in Vim? If it does, then there is
a screen refresh missing somewhere.

Best regards,
Tony.

rwmit...@gmail.com

unread,
Apr 13, 2021, 6:20:10 PM4/13/21
to vim_use
I think there (or at least in my case) is some plugin causing the issue.
I didn't even have to change terminals, just 'j' to the bottom of the first diff file and the screen went blank.
reran again using: vimdiff -u NONE -U NONE and it worked as expected.

I have nearly 50 plugins, so my motivation on figuring out which one is pretty low.

Peng Yu

unread,
Apr 13, 2021, 8:48:13 PM4/13/21
to vim_use
Indeed. Some plugins are causing the problem. But I also have any files in ~/.vim. How to easily figure out which one causes the problem?

Tony Mechelynck

unread,
Apr 14, 2021, 11:47:29 PM4/14/21
to vim_use
First, in your full session (with vimrc etc) go until the screen wakes
up blank. Then type (you may or may not have to blind-type)

:redir > ~/plugins.txt
:scriptnames
:redir END

This will write the list of all Vim scrpts sourced in this session
until that point, to a file named plugins.txt in your home directory,
but only if it doesn't exist yet (you may use any other name if you
already have a file by that name that you want to keep, or use :redir!
instead of :redir if you want to overwrite it). Then you may want to
open that text file in something other than Vim, or even to print it
so you can write on it the result of the following experiments:

If some of these scripts look like they might be causing the problem,
temporarily move them away to some place where Vim won't find them. If
none of them looks particularly suspicious, then move away about half
of them (not counting those which are distributed with Vim). Then
restart. If the problem reoccurs, it's one or more of those you kept
which is (are) the culprit. If it doesn't, then at least one of those
you moved away is all or part of the problem.

This way you ought to be able to cut the number of possible culprits
in half at each successive restart. Since 5 < log2(50) < 6, six tries
(or less if you're lucky or clever) ought to be enough to isolate the
culprit, at least if it's a single script. Maybe a few more tries if
it's two or more scripts throwing wrenches into each other's cogs.

Best regards,
Tony.

Peng Yu

unread,
Apr 17, 2021, 11:35:33 AM4/17/21
to vim_use
Here is what I have. I have tried to remove ~/.vim/ftdetect ~/.vim/bundle-available ~/.vim/after ~/.vim/plugin.

The problem is not gone.

When I try to remove ~/.vim, the problem is gone.

It is very hard to debug this problem.

Could this problem be due to some interaction between two plugins?

$ cat ~/plugins.txt
  1: /Applications/MacVim.app/Contents/Resources/vim/vimrc
  2: ~/.vimrc
  3: ~/.vim/autoload/pathogen.vim
  4: ~/.vim/filetype.vim
  5: /Applications/MacVim.app/Contents/Resources/vim/runtime/filetype.vim
  6: ~/.vim/ftdetect/bug.vim
  7: ~/.vim/ftdetect/json.vim
  8: ~/.vim/ftdetect/markdown.vim
  9: ~/.vim/ftdetect/sage.vim
 10: ~/.vim/bundle-available/jade/ftdetect/jade.vim
 11: ~/.vim/bundle-available/Nvim-R/ftdetect/r.vim
 12: ~/.vim/bundle-available/R-Vim-runtime/ftdetect/r_file_types.vim
 13: ~/.vim/bundle-available/vim-jq/ftdetect/jq.vim
 14: ~/.vim/bundle-available/vim-jst/ftdetect/jst.vim
 15: ~/.vim/bundle-available/vim-perl/ftdetect/mason-in-html.vim
 16: ~/.vim/bundle-available/vim-perl/ftdetect/perl11.vim
 17: ~/.vim/bundle-available/vim-racket/ftdetect/racket.vim
 18: ~/.vim/bundle-available/vim-scala/ftdetect/scala.vim
 19: ~/.vim/bundle-available/vim-solidity/ftdetect/solidity.vim
 20: ~/.vim/after/filetype.vim
 21: /Applications/MacVim.app/Contents/Resources/vim/runtime/ftplugin.vim
 22: /Applications/MacVim.app/Contents/Resources/vim/runtime/indent.vim
 23: /Applications/MacVim.app/Contents/Resources/vim/runtime/syntax/syntax.vim
 24: /Applications/MacVim.app/Contents/Resources/vim/runtime/syntax/synload.vim
 25: /Applications/MacVim.app/Contents/Resources/vim/runtime/syntax/syncolor.vim
 26: ~/.vim/plugin/a.vim
 27: ~/.vim/plugin/AnsiEscPlugin.vim
 28: ~/.vim/plugin/cecutil.vim
 29: ~/.vim/plugin/dbext.vim
 30: ~/.vim/plugin/head.vim
 31: ~/.vim/plugin/IndentAnything.vim
 32: ~/.vim/plugin/LargeFile.vim
 33: ~/.vim/plugin/matchit.vim
 34: ~/.vim/plugin/pydoc.vim
 35: ~/.vim/plugin/rails.vim
 36: ~/.vim/plugin/screen.vim
 37: ~/.vim/plugin/Tabular.vim
 38: ~/.vim/plugin/vimim.vim
 39: ~/.vim/bundle-available/cscope/plugin/cscope_maps.vim
 40: ~/.vim/bundle-available/diffchar/plugin/diffchar.vim
 41: ~/.vim/bundle-available/LanguageTool/plugin/LanguageTool.vim
 42: ~/.vim/bundle-available/nerdtree/plugin/NERD_tree.vim
 43: ~/.vim/bundle-available/nerdtree/autoload/nerdtree.vim
 44: ~/.vim/bundle-available/nerdtree/lib/nerdtree/path.vim
 45: ~/.vim/bundle-available/nerdtree/lib/nerdtree/menu_controller.vim
 46: ~/.vim/bundle-available/nerdtree/lib/nerdtree/menu_item.vim
 47: ~/.vim/bundle-available/nerdtree/lib/nerdtree/key_map.vim
 48: ~/.vim/bundle-available/nerdtree/lib/nerdtree/bookmark.vim
 49: ~/.vim/bundle-available/nerdtree/lib/nerdtree/tree_file_node.vim
 50: ~/.vim/bundle-available/nerdtree/lib/nerdtree/tree_dir_node.vim
 51: ~/.vim/bundle-available/nerdtree/lib/nerdtree/opener.vim
 52: ~/.vim/bundle-available/nerdtree/lib/nerdtree/creator.vim
 53: ~/.vim/bundle-available/nerdtree/lib/nerdtree/flag_set.vim
 54: ~/.vim/bundle-available/nerdtree/lib/nerdtree/nerdtree.vim
 55: ~/.vim/bundle-available/nerdtree/lib/nerdtree/ui.vim
 56: ~/.vim/bundle-available/nerdtree/lib/nerdtree/event.vim
 57: ~/.vim/bundle-available/nerdtree/lib/nerdtree/notifier.vim
 58: ~/.vim/bundle-available/nerdtree/autoload/nerdtree/ui_glue.vim
 59: ~/.vim/bundle-available/nerdtree/nerdtree_plugin/exec_menuitem.vim
 60: ~/.vim/bundle-available/nerdtree/nerdtree_plugin/fs_menu.vim
 61: ~/.vim/bundle-available/RST-Tables/plugin/rst_table.vim
 62: ~/.vim/bundle-available/vim-cython/plugin/cython.vim
 63: ~/.vim/bundle-available/vim-diff-enhanced/plugin/EnhancedDiff.vim
 64: ~/.vim/bundle-available/vim-indent-guides/plugin/indent_guides.vim
 65: ~/.vim/bundle-available/vim-indent-guides/autoload/indent_guides.vim
 66: ~/.vim/bundle-available/vim-latex-suite/plugin/filebrowser.vim
 67: ~/.vim/bundle-available/vim-latex-suite/plugin/imaps.vim
 68: ~/.vim/bundle-available/vim-latex-suite/plugin/libList.vim
 69: ~/.vim/bundle-available/vim-latex-suite/plugin/remoteOpen.vim
 70: ~/.vim/bundle-available/vim-latex-suite/plugin/SyntaxFolds.vim
 71: ~/.vim/bundle-available/vim-pandoc/plugin/pandoc.vim
 72: ~/.vim/bundle-available/vim-pandoc-syntax/plugin/pandoc-syntax-check.vim
 73: ~/.vim/bundle-available/vim-scala/plugin/scala.vim
 74: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/getscriptPlugin.vim
 75: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/gzip.vim
 76: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/logiPat.vim
 77: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/manpager.vim
 78: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/matchparen.vim
 79: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/netrwPlugin.vim
 80: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/rrhelper.vim
 81: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/spellfile.vim
 82: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/tarPlugin.vim
 83: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/tohtml.vim
 84: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/vimballPlugin.vim
 85: /Applications/MacVim.app/Contents/Resources/vim/runtime/plugin/zipPlugin.vim
 86: ~/.vim/bundle-available/vim-pandoc-after/plugin/pandoc-after.vim
Reply all
Reply to author
Forward
0 new messages