Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
运行python文件后在bash中运行的Vim命令_Python_Bash_Vim_Rhel_Rhel7 - Fatal编程技术网

运行python文件后在bash中运行的Vim命令

运行python文件后在bash中运行的Vim命令,python,bash,vim,rhel,rhel7,Python,Bash,Vim,Rhel,Rhel7,在运行python单元测试文件之后,我遇到了一个问题。一旦文件退出,我只能在按下“I”并使用其他vim键绑定后与控制台交互。我还注意到,使用箭头键遍历我键入的内容将删除行尾随机数目的字符 例: 听起来好像你的外壳被放进了盒子里。这是一种可以使用vi编辑键而不是更常用的emacs键的模式 我知道这有两种可能发生的方式 set-o vi bindkey-v 从技术上讲,要关闭它,请使用set+o vi。但是,这将禁用所有内联编辑。您更可能希望返回到emacs模式,这通常是默认模式。为此,请改为执行

在运行python单元测试文件之后,我遇到了一个问题。一旦文件退出,我只能在按下“I”并使用其他vim键绑定后与控制台交互。我还注意到,使用箭头键遍历我键入的内容将删除行尾随机数目的字符

例:


听起来好像你的外壳被放进了盒子里。这是一种可以使用vi编辑键而不是更常用的emacs键的模式

我知道这有两种可能发生的方式

set-o vi
bindkey-v
从技术上讲,要关闭它,请使用
set+o vi
。但是,这将禁用所有内联编辑。您更可能希望返回到emacs模式,这通常是默认模式。为此,请改为执行以下操作:

set-o emacs

tests.py看起来像什么如上所述,我不能真正显示真正的test.py,但本质上我将创建变量,运行与ansible接口的命令,打印输出并传递。@DanLowe这是我的问题!如果你把你的评论写在回答中,我会把它标记为正确的!
$ ./tests.py -v
<output>
$ <cannot type>
<press "i">
$ I can now type
<press <- >
$ I can no
#!/usr/bin/env python

import unittest

class TestUtil(unittest.TestCase):
    def test_hello_world(self):
        text = "Hello World!"
        self.assertEqual("Hello World!", text)
        print(text)
        pass
if __name__ == '__main__':
    unittest.main()