Mercurial > vim
comparison src/testdir/test_terminal3.vim @ 24268:9257f3980f4a v8.2.2675
patch 8.2.2675: directory change in a terminal window shell is not followed
Commit: https://github.com/vim/vim/commit/8b9abfd86c736ed3f298dfa8b50a962c118b3983
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Mar 29 20:49:05 2021 +0200
patch 8.2.2675: directory change in a terminal window shell is not followed
Problem: Directory change in a terminal window shell is not followed.
Solution: Add the 'autoshelldir' option. (closes https://github.com/vim/vim/issues/6290)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 29 Mar 2021 21:00:03 +0200 |
parents | e27b5529dc6a |
children | 477b0a892a85 |
comparison
equal
deleted
inserted
replaced
24267:57c5644a9065 | 24268:9257f3980f4a |
---|---|
473 set mousetime& | 473 set mousetime& |
474 call delete('Xtest_mouse') | 474 call delete('Xtest_mouse') |
475 call delete('Xbuf') | 475 call delete('Xbuf') |
476 endfunc | 476 endfunc |
477 | 477 |
478 " Test for sync buffer cwd with shell's pwd | |
479 func Test_terminal_sync_shell_dir() | |
480 CheckUnix | |
481 " The test always use sh (see src/testdir/unix.vim). | |
482 " However, BSD's sh doesn't seem to play well with OSC 7 escape sequence. | |
483 CheckNotBSD | |
484 | |
485 set asd | |
486 " , is | |
487 " 1. a valid character for directory names | |
488 " 2. a reserved character in url-encoding | |
489 let chars = ",a" | |
490 " "," is url-encoded as '%2C' | |
491 let chars_url = "%2Ca" | |
492 let tmpfolder = fnamemodify(tempname(),':h').'/'.chars | |
493 let tmpfolder_url = fnamemodify(tempname(),':h').'/'.chars_url | |
494 call mkdir(tmpfolder, "p") | |
495 let buf = Run_shell_in_terminal({}) | |
496 call term_sendkeys(buf, "echo -ne $'\\e\]7;file://".tmpfolder_url."\\a'\<CR>") | |
497 "call term_sendkeys(buf, "cd ".tmpfolder."\<CR>") | |
498 call TermWait(buf) | |
499 if has("mac") | |
500 let expected = "/private".tmpfolder | |
501 else | |
502 let expected = tmpfolder | |
503 endif | |
504 call assert_equal(expected, getcwd(winnr())) | |
505 endfunc | |
506 | |
478 " Test for modeless selection in a terminal | 507 " Test for modeless selection in a terminal |
479 func Test_term_modeless_selection() | 508 func Test_term_modeless_selection() |
480 CheckUnix | 509 CheckUnix |
481 CheckNotGui | 510 CheckNotGui |
482 CheckRunVimInTerminal | 511 CheckRunVimInTerminal |