简体   繁体   English

MrBayes 3.2.6 Linux箭头键不起作用

[英]MrBayes 3.2.6 Linux Arrow keys not working

Not sure this is the best place to ask for this, but since the other MrBayes questions were also posted here, I'll give it a try. 不确定这是问这个问题的最佳地点,但是由于其他MrBayes问题也已发布在这里,因此我将尝试一下。

So I'm trying to run MrBayes on Arch Linux (4.4.1-2-ARCH) and the program works fine but the arrow keys don't work. 因此,我试图在Arch Linux(4.4.1-2-ARCH)上运行MrBayes,该程序可以正常运行,但是箭头键不起作用。

The output for the arrow keys looks like this: 箭头键的输出如下所示:

MrBayes > ^[[A^[[C^[[B^[[D

In the terminal (xterm etc.) the arrow keys work just fine. 在终端(xterm等)中,箭头键可以正常工作。

Googling this turned up nothing... Any idea why this happens? 谷歌搜索什么都没发现……为什么会这样?

Arrow keys on almost all terminals send escape sequences. 几乎所有终端上的箭头键都会发送转义序列。 If a program handles arrow keys, it does this by noticing that an escape character is read, and follows up by looking for the rest of the escape sequence. 如果程序处理箭头键,则它会通过注意读取转义字符来进行此操作,然后通过查找转义序列的其余部分来进行跟踪。

A program that does not expect escape sequences would generally be using the default terminal I/O modes, in which the operating system's terminal driver conventionally echoes an escape character as ^[ (because on most keyboards you can type an escape character that way). 指望转义序列的程序一般会使用默认的终端I / O模式,在该操作系统的终端驱动程序通常呼应转义字符为^[ (因为大多数键盘上,你可以键入转义字符的方式)。

From your description, it sounds as if MyBayes does not expect escape sequences. 根据您的描述,听起来好像MyBayes不需要转义序列。

Rather than using arrow keys for command-line editing, you should be able to use the backspace or delete ( erase ) character which the terminal sends. 而不是使用箭头键来进行命令行编辑,您应该能够使用退格键或终端发送的删除( 擦除 )字符。

To fix this behaviour, installing rlwrap does the trick. 要解决此问题,安装rlwrap可以解决问题。
rlwrap will convert the escape characters to their corresponding actions and also provides a history. rlwrap会将转义符转换为相应的动作,并提供历史记录。 Sadly though no tab-completion for directories. 遗憾的是,目录没有制表符补全功能。

For linux execute MrBayes like this: 对于linux,请像下面这样执行MrBayes:

$ rlwrap mb

or for mpi version: 或针对MPI版本:

$ rlwrap mpirun -np x mb

where x is number of processors/threads used. 其中x是使用的处理器/线程数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM