简体   繁体   English

在命令行中触发UP键?

[英]Trigger the UP key in command line?

Is there a way to trigger/fire the UP key in the command line? 有没有一种方法可以在命令行中触发/触发UP键?

Instead of me having to press UP key. 而不是我必须按UP键。

如果已经输入xvkbd安装,你一个使用它的-text选项为任何字符串发送到焦点窗口为:

xvkbd  -text "\[Up]"

This sounds like an XY Problem to me. 在我看来,这听起来像是XY问题

If what you really want to do is to be able to access and execute a previous command in the history without pressing up-arrow, there are various ways to do that: 如果您真正想做的是无需按向上箭头就可以访问和执行历史记录中的上一个命令,则可以通过多种方法进行:

  • !! will execute the previous command 将执行上一条命令
  • Ctrl - r string will allow you to search for previous commands Ctrl - r string将允许您搜索以前的命令
  • !string searches for a command beginning with "string" !string搜索以“ string”开头的命令
  • !?string searches for a command containing with "string" !?string搜索包含“ string”的命令

You can bind Up to different key combination using xmodmap . 您可以使用xmodmapUp绑定到不同的组合键。

The following works for me binding the key to Alt Gr - W (right Alt on some keyboard layouts). 对我来说,以下工作结合的关键,Alt键的Gr - (在某些键盘布局右Alt)W

xmodmap -e 'keycode 25 = w W Up Up Up'

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

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