diff src/testdir/test_terminal3.vim @ 27098:8bb07c88ac27 v8.2.4078

patch 8.2.4078: terminal test for current directory not used on FreeBSD Commit: https://github.com/vim/vim/commit/ced2b38a560cc4f4ec983ed2cf4372ab62e1dbc1 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jan 13 15:25:32 2022 +0000 patch 8.2.4078: terminal test for current directory not used on FreeBSD Problem: Terminal test for current directory not used on FreeBSD. Solution: Make it work on FreeBSD. (Ozaki Kiichi, closes https://github.com/vim/vim/issues/9516) Add TermWait() inside Run_shell_in_terminal() as a generic solution.
author Bram Moolenaar <Bram@vim.org>
date Thu, 13 Jan 2022 16:30:04 +0100
parents 1eb62546e20c
children 2961745336b8
line wrap: on
line diff
--- a/src/testdir/test_terminal3.vim
+++ b/src/testdir/test_terminal3.vim
@@ -779,8 +779,6 @@ endfunc
 func Test_terminal_sync_shell_dir()
   CheckUnix
   " The test always use sh (see src/testdir/unix.vim).
-  " However, BSD's sh doesn't seem to play well with OSC 7 escape sequence.
-  CheckNotBSD
 
   set asd
   " , is
@@ -789,15 +787,15 @@ func Test_terminal_sync_shell_dir()
   let chars = ",a"
   " "," is url-encoded as '%2C'
   let chars_url = "%2Ca"
-  let tmpfolder = fnamemodify(tempname(),':h').'/'.chars
-  let tmpfolder_url = fnamemodify(tempname(),':h').'/'.chars_url
+  let tmpfolder = fnamemodify(tempname(),':h') .. '/' .. chars
+  let tmpfolder_url = fnamemodify(tempname(),':h') .. '/' .. chars_url
   call mkdir(tmpfolder, "p")
   let buf = Run_shell_in_terminal({})
-  call term_sendkeys(buf, "echo -ne $'\\e\]7;file://".tmpfolder_url."\\a'\<CR>")
-  "call term_sendkeys(buf, "cd ".tmpfolder."\<CR>")
+  call term_sendkeys(buf, "echo $'\\e\]7;file://" .. tmpfolder_url .. "\\a'\<CR>")
+  "call term_sendkeys(buf, "cd " .. tmpfolder .. "\<CR>")
   call TermWait(buf)
   if has("mac")
-    let expected = "/private".tmpfolder
+    let expected = "/private" .. tmpfolder
   else
     let expected = tmpfolder
   endif