ex_actions.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:NeoVintageous 作者: NeoVintageous 项目源码 文件源码
def run(self, command_line=''):
        assert command_line, 'expected non-empty command line'

        if platform() == 'linux':
            term = self.view.settings().get('VintageousEx_linux_terminal')
            term = term or os.environ.get('COLORTERM') or os.environ.get("TERM")
            if not term:
                nvim.status_message('not terminal name found')
                return
            try:
                self.open_shell([term, '-e', 'bash']).wait()
            except Exception as e:
                nvim.console_message(e)
                nvim.status_message('error while executing command through shell')
                return
        elif platform() == 'osx':
            term = self.view.settings().get('VintageousEx_osx_terminal')
            term = term or os.environ.get('COLORTERM') or os.environ.get("TERM")
            if not term:
                nvim.status_message('not terminal name found')
                return
            try:
                self.open_shell([term, '-e', 'bash']).wait()
            except Exception as e:
                nvim.console_message(e)
                nvim.status_message('error while executing command through shell')
                return
        elif platform() == 'windows':
            self.open_shell(['cmd.exe', '/k']).wait()
        else:
            # XXX OSX (make check explicit)
            nvim.not_implemented_message('not implemented')


# https://vimhelp.appspot.com/insert.txt.html#:r
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号