Repository: neovim/neovim
File: runtime/lua/vim/_defaults.lua (Lua)

Code before:
      })
      for _, file in ipairs(files) do
        local trusted = vim.secure.read(file) --[[@as string|nil]]
        if trusted then
          if vim.endswith(file, '.lua') then
            assert(loadstring(trusted, '@' .. file))()
          else
            vim.api.nvim_exec2(trusted, {})
          end
        end
        -- If the user unset 'exrc' in the current exrc then stop searching
        if not vim.o.exrc then
          return
        end
      end
    end,
  })

  if tty then
    -- Show progress bars in supporting terminals
    vim.api.nvim_create_autocmd('Progress', {
      group = vim.api.nvim_create_augroup('nvim.progress', {}),
      desc = 'Display native progress bars',
      callback = function(ev)
        if ev.data.status == 'running' then
          vim.api.nvim_ui_send(string.format('\027]9;4;1%d\027\\', ev.data.percent))
        else
          vim.api.nvim_ui_send('\027]9;4;0;0\027\\')
        end
      end,
    })
  end
end

--- Default options
do
  --- Default 'grepprg' to ripgrep if available.
  if vim.fn.executable('rg') == 1 then
    -- Use -uu to make ripgrep not check ignore files/skip dot-files
    vim.o.grepprg = 'rg --vimgrep -uu '
    vim.o.grepformat = '%f:%l:%c:%m'
  end
end


Review comment (security):
For some reason this escape sequence give me desktop notification (gnome-shell on Debian Sid, ghostty: master from source) instead of the progress bar. 

<img width="429" height="116" alt="image" src="https://github.com/user-attachments/assets/63024e69-e945-4b7b-8354-fdaf7bcabbb5" />

I tested it on the example from docs:
```lua
vim.api.nvim_echo({ { 'searching...' } }, true, {kind = 'progress', status = 'running', percent = 10, title = 'term'})
```
I get the expected result with `vim.api.nvim_ui_send(string.format('\x1b]9;4;1;%s\x07', 33))`

<img width="585" height="139" alt="image" src="https://github.com/user-attachments/assets/a0fc1451-be6f-4c23-b2c1-24294a2f9a25" />

(the example taken from https://github.com/ghostty-org/ghostty/discussions/8823).

Code after:
      })
      for _, file in ipairs(files) do
        local trusted = vim.secure.read(file) --[[@as string|nil]]
        if trusted then
          if vim.endswith(file, '.lua') then
            assert(loadstring(trusted, '@' .. file))()
          else
            vim.api.nvim_exec2(trusted, {})
          end
        end
        -- If the user unset 'exrc' in the current exrc then stop searching
        if not vim.o.exrc then
          return
        end
      end
    end,
  })

  if tty then
    -- Show progress bars in supporting terminals
    vim.api.nvim_create_autocmd('Progress', {
      group = vim.api.nvim_create_augroup('nvim.progress', {}),
      desc = 'Display native progress bars',
      callback = function(ev)
        if ev.data.status == 'running' then
          vim.api.nvim_ui_send(string.format('\027]9;4;1;%d\027\\', ev.data.percent))
        else
          vim.api.nvim_ui_send('\027]9;4;0;0\027\\')
        end
      end,
    })
  end
end

--- Default options
do
  --- Default 'grepprg' to ripgrep if available.
  if vim.fn.executable('rg') == 1 then
    -- Use -uu to make ripgrep not check ignore files/skip dot-files
    vim.o.grepprg = 'rg --vimgrep -uu '
    vim.o.grepformat = '%f:%l:%c:%m'
  end
end