Solved GVIM - does not want to edit a simple job file.

I have a one-line shell script that I submit to the background from the command line. I saved this as a file named np4178.job. When I look at np4178.job using more I see this:

Code:
export HPNP=4178 ; socat TCP4-LISTEN:4178,bind=192.168.216.179,fork,reuseaddr,su=hp3000 SYSTEM:'sed -r "1s/^.{42}//" | cat /var/spool/hp3000/forms/hll_inv_ljiii_85.ovl - | gpcl6 -dNOSAFE -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=/var/spool/hp3000/np${HPNP}/HP3000-INV-$(date -Iseconds)-%03u.pdf -' &

When I open this file in vim I also see the text content. However, if I open the file in gvim then I see this:

gvim.png


What is happening?
 
Did you try other "text" files?

Part of what's happening: This looks like the font you're using in gvim is missing ALL the glyphs, so, as a replacement, the hex codes of the unicode characters are displayed…
 
It looks like gvim is set to some weird font. Does this happen with any text file you open?
 
This is affecting more than one account on the same host. Both accounts use a similar vimrc. The vimrc has not been updated since October 2018.

Gvim was operating correctly yesterday. The last invocation that I know worked for me was:

2021-05-20 08:10:04: gvim freebsd/bash/hp3000_inv_pdf_xfr.sh

The last pkg upgrade or install before yesterday was on May 4. The pkg upgrade yesterday was for Firefox and its dependencies.

Code:
May 20 15:33:09 vhost01 pkg[51127]: png upgraded: 1.6.37 -> 1.6.37_1
May 20 15:33:11 vhost01 pkg[51127]: glib upgraded: 2.66.7,1 -> 2.66.7_1,1
May 20 15:33:11 vhost01 pkg[51127]: fontconfig upgraded: 2.13.92_2,1 -> 2.13.93,1
May 20 15:33:12 vhost01 pkg[51127]: libdrm upgraded: 2.4.103,1 -> 2.4.104,1
May 20 15:33:12 vhost01 pkg[51127]: nspr upgraded: 4.29 -> 4.30
May 20 15:33:12 vhost01 pkg[51127]: harfbuzz upgraded: 2.7.4 -> 2.8.0
May 20 15:33:13 vhost01 pkg[51127]: libvpx upgraded: 1.9.0 -> 1.10.0
May 20 15:33:14 vhost01 pkg[51127]: dav1d upgraded: 0.8.1 -> 0.9.0
May 20 15:33:14 vhost01 pkg[51127]: aom upgraded: 2.0.2 -> 3.1.0
May 20 15:33:18 vhost01 pkg[51127]: gtk3 upgraded: 3.24.24 -> 3.24.27
May 20 15:33:19 vhost01 pkg[51127]: libXt upgraded: 1.2.0,1 -> 1.2.1,1
May 20 15:33:19 vhost01 pkg[51127]: webp upgraded: 1.1.0 -> 1.2.0
May 20 15:33:20 vhost01 pkg[51127]: nss upgraded: 3.61 -> 3.65
May 20 15:33:22 vhost01 pkg[51127]: ffmpeg upgraded: 4.3.1_9,1 -> 4.3.2_1,1
May 20 15:33:28 vhost01 pkg[51127]: firefox upgraded: 85.0.2,2 -> 88.0.1_1,2

The only pkg installed this morning was hs-ShellCheck. I also upgraded vim after the problem was encountered. This had no effect on the problem. When I open the Edit -> Select Font sub-menu inside Gvim there is no font specified. Setting a font corrects the problem so the issue is the absence of a font to display data, possibly. Without a font set then using :set guifont displays something, but without glyphs I cannot set what it is saying. Once the font is set in the menu then of course that is the font one sees when :set guifont is used.

The .vimrc file contains this:

Code:
if has("gui_running")
  :set guifont=Bitstream\ Vers\ Sans\ Mono\ cANSI
  :set lines=31
  :set columns=86
endif

Bitstream Vera Sans Mono Roman is available from the font selection list in Gvim and manually setting this inside the program returns Gvim's display to the one I am accustomed to use.

The question is: What is causing Gvim to not load the font specified? The next question is: What changed to have this effect on Gvim?
 
Bitstream Vera Sans Mono Roman is available from the font selection list in Gvim and manually setting this inside the program returns Gvim's display to the one I am accustomed to use.
Yes, but your .vimrc is set to "Bitstream Vers Sans Mono cANSI" (note the "Vers" typo and the "cANSI"), not "Bitstream Vera Sans Mono Roman".
 
Yes, you are right. Fixing the typo resolves the problem. Odd that it worked for so many years and then stopped.
 
A behavior underneath could have changed. The "i don't have this font so let me pick one to use" changed somewhere, it used to maybe pick a close one, now it just arbitrarily picks one.
Typos always wind up killing us; you stare at it for hours, never see it. Someone looks at it and 2 seconds "right there is the problem".
Glad it was that simple.
 
It has been present for ages. I went though all the other accounts' .vimrc files and they all have the same error and they are all years old. I have no idea what updating firefox could have done that triggered this, but that was the only change made to the host in the past two weeks.
 
I note I was right, but still I'm a bit surprised. Showing all the hex codes of (unicode) characters is a way to deal with a "missing font", but one that doesn't seem all too useful to the user.

Ok, maybe the motivation was "fail fast". If it would just pick a different font, you might never notice that your configuration was wrong ;)
 
  • Thanks
Reactions: mer
I have no idea what updating firefox could have done that triggered this, but that was the only change made to the host in the past two weeks.
About the only thing that makes sense to me is pre firefox update you actually had a font named Bitstream\ Vers\ Sans\ Mono\ cANSI but it got removed when updating firefox.

Make sense? No, but it's the only thing I can come up with.
 
Back
Top