Skip to content

Commit f5cf0b1

Browse files
feat: allow changing terminal dir in background (#438)
1 parent 26f16d3 commit f5cf0b1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lua/toggleterm/terminal.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -325,10 +325,10 @@ function Terminal:clear() self:send("clear") end
325325

326326
---Update the directory of an already opened terminal
327327
---@param dir string
328-
function Terminal:change_dir(dir)
328+
function Terminal:change_dir(dir, go_back)
329329
dir = _get_dir(dir)
330330
if self.dir == dir then return end
331-
self:send({ fmt("cd %s", dir), "clear" })
331+
self:send({ fmt("cd %s", dir), "clear" }, go_back)
332332
self.dir = dir
333333
end
334334

0 commit comments

Comments
 (0)