Emacs doesn't show the line number if it is the last line and the line is empty. Apparently, this is by design, but in the mode line, it shows the line number.
My line number configuration is like this:
(setq display-line-numbers-type 'visual) (global-display-line-numbers-mode -1) (require 'conf-mode) (dolist (mode '(org-mode-hook ; All the modes to have line numbers prog-mode-hook conf-mode-hook text-mode-hook dired-mode-hook Man-mode-hook)) (add-hook mode '(lambda () (display-line-numbers-mode 1)))) How can I get Emacs to display the line number (on the left-hand side with all the other line numbers) when I'm on the last, empty line?

printf "foo\nbar" | wc -l, for example.