Skip to content

Commit

Permalink
Use 'columns' and 'lines' based fallback for terminal win width & height
Browse files Browse the repository at this point in the history
Relates to #1416
  • Loading branch information
mfussenegger committed Jan 7, 2025
1 parent 0e673ac commit b768c8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/dap/session.lua
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ local function run_in_terminal(lsession, request)
local opts = {
env = next(body.env or {}) and body.env or vim.empty_dict(),
cwd = (body.cwd and body.cwd ~= '') and body.cwd or nil,
height = terminal_win and api.nvim_win_get_height(terminal_win) or 40,
width = terminal_win and api.nvim_win_get_width(terminal_win) or 80,
height = terminal_win and api.nvim_win_get_height(terminal_win) or math.ceil(vim.o.lines / 2),
width = terminal_win and api.nvim_win_get_width(terminal_win) or vim.o.columns,
pty = true,
on_stdout = function(_, data)
local count = #data
Expand Down

0 comments on commit b768c8d

Please sign in to comment.