Mercurial > vim
comparison src/testdir/test_terminal.vim @ 13898:ea0e6c71ba51 v8.0.1820
patch 8.0.1820: terminal window redirecting stdout does not show stderr
commit https://github.com/vim/vim/commit/cd8fb449d6486a1a5a09c8c098ea3a38c19e8dc5
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat May 12 17:42:42 2018 +0200
patch 8.0.1820: terminal window redirecting stdout does not show stderr
Problem: Terminal window redirecting stdout does not show stderr. (Mat?o
Zanibelli)
Solution: When stdout is not connected to pty_master_fd then use it for
stderr. (closes #2903)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 12 May 2018 17:45:05 +0200 |
parents | 7f892e37b017 |
children | b94a9171ec7c |
comparison
equal
deleted
inserted
replaced
13897:d74b3df1aea3 | 13898:ea0e6c71ba51 |
---|---|
1482 | 1482 |
1483 let job = term_getjob(buf) | 1483 let job = term_getjob(buf) |
1484 call feedkeys("\<C-L>\<C-C>", 'tx') | 1484 call feedkeys("\<C-L>\<C-C>", 'tx') |
1485 call WaitForAssert({-> assert_equal("dead", job_status(job))}) | 1485 call WaitForAssert({-> assert_equal("dead", job_status(job))}) |
1486 endfunc | 1486 endfunc |
1487 | |
1488 func Test_terminal_out_err() | |
1489 if !has('unix') | |
1490 return | |
1491 endif | |
1492 call writefile([ | |
1493 \ '#!/bin/sh', | |
1494 \ 'echo "this is standard error" >&2', | |
1495 \ 'echo "this is standard out" >&1', | |
1496 \ ], 'Xechoerrout.sh') | |
1497 call setfperm('Xechoerrout.sh', 'rwxrwx---') | |
1498 | |
1499 let outfile = 'Xtermstdout' | |
1500 let buf = term_start(['./Xechoerrout.sh'], {'out_io': 'file', 'out_name': outfile}) | |
1501 call WaitForAssert({-> assert_inrange(1, 2, len(readfile(outfile)))}) | |
1502 call assert_equal("this is standard out", readfile(outfile)[0]) | |
1503 call assert_equal('this is standard error', term_getline(buf, 1)) | |
1504 | |
1505 exe buf . 'bwipe' | |
1506 call delete('Xechoerrout.sh') | |
1507 call delete(outfile) | |
1508 endfunc |