From e28907b69dbfbae6b4cf66a906533edc5cfe9844 Mon Sep 17 00:00:00 2001 From: William Boman Date: Wed, 28 Dec 2022 10:36:15 +0100 Subject: fix(powershell): terminate stdin with newline (#818) Powershell doesn't seem to be closing the process after commands finsh executing and stdin is closed, not entirely sure why. This seems to fix the issue. --- tests/mason-core/managers/powershell_spec.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/mason-core/managers/powershell_spec.lua b/tests/mason-core/managers/powershell_spec.lua index 0229388a..eb9de00f 100644 --- a/tests/mason-core/managers/powershell_spec.lua +++ b/tests/mason-core/managers/powershell_spec.lua @@ -76,7 +76,7 @@ describe("powershell manager", function() powershell().script "echo 'Is this bash?'" assert.spy(spawn.pwsh).was_called(1) - assert.spy(vim.loop.write).was_called(4) + assert.spy(vim.loop.write).was_called(5) assert .spy(vim.loop.write) .was_called_with(match.is_ref(stdin), [[ $ErrorActionPreference = "Stop"; ]], match.is_function()) @@ -89,6 +89,7 @@ describe("powershell manager", function() match.is_function() ) assert.spy(vim.loop.write).was_called_with(match.is_ref(stdin), "echo 'Is this bash?'", match.is_function()) + assert.spy(vim.loop.write).was_called_with(match.is_ref(stdin), "\n", match.is_function()) assert.spy(vim.loop.shutdown).was_called(1) assert.spy(vim.loop.shutdown).was_called_with(match.is_ref(stdin), match.is_function()) end) -- cgit v1.2.3-70-g09d2