Commit: runtime(manpager): use \x07 instead of \a for BEL in OSC 8 regex

0 views
Skip to first unread message

Christian Brabandt

unread,
4:02 PM (7 hours ago) 4:02 PM
to vim...@googlegroups.com
runtime(manpager): use instead of for BEL in OSC 8 regex

Commit: https://github.com/vim/vim/commit/a603175c6cbe1f8aa37493c421f91a0dc49dff3d
Author: Yasuhiro Matsumoto <matt...@gmail.com>
Date: Tue Mar 24 19:45:04 2026 +0000

runtime(manpager): use \x07 instead of for BEL in OSC 8 regex

in Vim's regex matches [A-Za-z], not the BEL character (0x07).
This caused the OSC 8 hyperlink stripping pattern to incorrectly
match alphabetic characters, breaking man page display.

Use \x07 (inside []) and %x07 (outside []) to correctly match BEL.

closes: #19806

Signed-off-by: Yasuhiro Matsumoto <matt...@gmail.com>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/runtime/plugin/manpager.vim b/runtime/plugin/manpager.vim
index e0d269743..e3a8ea55a 100644
--- a/runtime/plugin/manpager.vim
+++ b/runtime/plugin/manpager.vim
@@ -2,6 +2,7 @@
" Maintainer: Enno Nagel <ennona...@gmail.com>
" Last Change: 2024 Jul 03
" 2026 Mar 22 by Vim Project: strip OSC 9 sequences (#19787)
+" 2026 Mar 24 by Vim Project: strip Bell char: Ctrl-G (#19807)

if exists('g:loaded_manpager_plugin')
finish
@@ -33,8 +34,8 @@ function s:ManPager()
" Remove ansi sequences
exe 'silent! keepj keepp %s/ \[%(%(\d;)?\d{1,2})?[mK]//e' .. (&gdefault ? '' : 'g')

- " Remove OSC 8 hyperlink sequences: ]8;;... \ or ]8;;...
- exe 'silent! keepj keepp %s/ \]8;[^ ]*%( | \)//e' .. (&gdefault ? '' : 'g')
+ " Remove OSC 8 hyperlink sequences: ]8;;... \ or ]8;;...<BEL>
+ exe 'silent! keepj keepp %s/ \]8;[^\x07 ]*%(%x07| \)//e' .. (&gdefault ? '' : 'g')

" Remove empty lines above the header
call cursor(1, 1)
Reply all
Reply to author
Forward
0 new messages