| 1 | "============================================================================= |
|---|
| 2 | " FILE: screen.vim |
|---|
| 3 | " AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com> |
|---|
| 4 | " Last Modified: 07 May 2009 |
|---|
| 5 | " Usage: Just source this file. |
|---|
| 6 | " License: MIT license {{{ |
|---|
| 7 | " Permission is hereby granted, free of charge, to any person obtaining |
|---|
| 8 | " a copy of this software and associated documentation files (the |
|---|
| 9 | " "Software"), to deal in the Software without restriction, including |
|---|
| 10 | " without limitation the rights to use, copy, modify, merge, publish, |
|---|
| 11 | " distribute, sublicense, and/or sell copies of the Software, and to |
|---|
| 12 | " permit persons to whom the Software is furnished to do so, subject to |
|---|
| 13 | " the following conditions: |
|---|
| 14 | " |
|---|
| 15 | " The above copyright notice and this permission notice shall be included |
|---|
| 16 | " in all copies or substantial portions of the Software. |
|---|
| 17 | " |
|---|
| 18 | " THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
|---|
| 19 | " OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
|---|
| 20 | " MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
|---|
| 21 | " IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
|---|
| 22 | " CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
|---|
| 23 | " TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
|---|
| 24 | " SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|---|
| 25 | " }}} |
|---|
| 26 | " Version: 1.1, for Vim 7.0 |
|---|
| 27 | "----------------------------------------------------------------------------- |
|---|
| 28 | " ChangeLog: "{{{ |
|---|
| 29 | " 1.1: |
|---|
| 30 | " - Fixed error. |
|---|
| 31 | " 1.0: |
|---|
| 32 | " - Initial version. |
|---|
| 33 | ""}}} |
|---|
| 34 | "----------------------------------------------------------------------------- |
|---|
| 35 | " TODO: "{{{ |
|---|
| 36 | " - Nothing. |
|---|
| 37 | ""}}} |
|---|
| 38 | " Bugs"{{{ |
|---|
| 39 | " - |
|---|
| 40 | ""}}} |
|---|
| 41 | "============================================================================= |
|---|
| 42 | |
|---|
| 43 | function! vimshell#internal#screen#execute(program, args, fd, other_info) |
|---|
| 44 | " Execute program in screen. |
|---|
| 45 | if &term =~ "^screen" |
|---|
| 46 | silent execute printf('!screen %s', join(a:args)) |
|---|
| 47 | elseif has('win32') || has('win64') |
|---|
| 48 | if g:VimShell_UseCkw |
|---|
| 49 | " Use ckw. |
|---|
| 50 | silent execute printf('!start ckw -e %s %s %s', &shell, &shellcmdflag, join(a:args)) |
|---|
| 51 | else |
|---|
| 52 | silent execute printf('!start %s', join(a:args)) |
|---|
| 53 | endif |
|---|
| 54 | else |
|---|
| 55 | " For *nix. |
|---|
| 56 | |
|---|
| 57 | " Background execute. |
|---|
| 58 | call system(join(a:args) . '&') |
|---|
| 59 | endif |
|---|
| 60 | endfunction |
|---|