screen icon indicating copy to clipboard operation
screen copied to clipboard

Mac OS X default terminal application

Open onemanstartup opened this issue 12 years ago • 8 comments

Instead of Terminal.app make iTerm2 or make settings to allow override

onemanstartup avatar Aug 11 '13 03:08 onemanstartup

Have you looked at :h g:ScreenShellTerminal? Does that not do what you want?

ervandew avatar Aug 11 '13 03:08 ervandew

I'd also be happy to add iTerm2 to the list of default terminals to look for on OSX if you can give me the exact string to put into the s:terminals list in autoload/screen.vim (I don't have OSX available currently to test that myself). Or you could provide a working pull request which adds that string.

ervandew avatar Aug 11 '13 03:08 ervandew

Sorry didn't see settings, but after I set let g:ScreenShellTerminal = 'iTerm.app' I get error when calling ScreenShell from MacVim Error detected while processing function screen#ScreenShell..<SNR>51_ScreenInit: line 85: also ScreenShellVertical don't work in gui, but it will be great if it just symlink this for usual ScreenShell

onemanstartup avatar Aug 11 '13 03:08 onemanstartup

after I set let g:ScreenShellTerminal = 'iTerm.app'

Is it iTerm.app or iTerm2.app?

I get error when calling ScreenShell from MacVim Error detected while processing function screen#ScreenShell..<SNR>51_ScreenInit: line 85:

Here is what screen.vim is doing under the covers to start the terminal:

return 'silent !osascript -e "tell application \"' . a:term .
  \ '\"" -e "do script \"' . a:cmd . '\"" -e "end tell"'

Can you try running something like that manually to see if a meaningful error is returned (replace screen with tmux if that's what you're using):

:!osascript -e "tell application \"iTerm.app\"" -e "do script \"screen\"" -e "end tell"

You may want to try it without the .app extension too.

also ScreenShellVertical don't work in gui

:ScreenShellVertical doesn't work in the gui because you're opening a terminal, not splitting one.

but it will be great if it just symlink this for usual ScreenShell

I prefer to omit commands for configurations/environments that don't support them. If the command simply calls :ScreenShell instead then that could be confusing for other users. You can of course create your own command in your vimrc which calls it though.

ervandew avatar Aug 11 '13 03:08 ervandew

tried iTerm (just worked in AppleScript) - the same

applescript give me error this this line you gave - Expected end of line but found “script”.

onemanstartup avatar Aug 11 '13 04:08 onemanstartup

I finally had a chance to play with this on an OSX machine and I couldn't come up with applescript that worked properly. I was able to create some that launched iterm2 for the first time and ran a command in the resulting shell, but that same code would fail if iterm2 was closed without fully quiting the application. Also if a term was already open it wouldn't create a new one like I wanted. But the code to create a new session would then result in 2 windows if no iterm2 app was currently running.

So my conclusion is that iterm2's applescript interface isn't sufficient for how screen.vim works, or that my lack of applescript knowledge prevents me from finding the magic to make it work as expected. I'll leave this ticket open should someone come along and provide a working solution, but until then I'm afraid that iTerm2 is unsupported by screen.vim.

ervandew avatar Sep 23 '13 01:09 ervandew

~~For what it's worth, let g:ScreenShellTerminal = 'iTerm.app' seems to be working for me.~~ Sorry. Spoke too fast.

dpo avatar May 05 '15 23:05 dpo

Maybe these can help: https://github.com/tpope/vim-dispatch/blob/master/autoload/dispatch/iterm.vim https://gitlab.com/gnachman/iterm2/wikis/Applescript

dpo avatar May 07 '15 20:05 dpo