never_had_a_name
never_had_a_name

Reputation: 93186

Trigger the UP key in command line?

Is there a way to trigger/fire the UP key in the command line?

Instead of me having to press UP key.

Upvotes: 1

Views: 1133

Answers (3)

codaddict
codaddict

Reputation: 455020

If you have xvkbd installed, you an use its -text option to send any string to the focused window as:

xvkbd  -text "\[Up]"

Upvotes: 1

Paweł Nadolski
Paweł Nadolski

Reputation: 8474

You can bind Up to different key combination using xmodmap.

The following works for me binding the key to Alt Gr-W (right Alt on some keyboard layouts).

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

Upvotes: 0

Dennis Williamson
Dennis Williamson

Reputation: 360055

This sounds like an XY Problem to me.

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-rstring will allow you to search for previous commands
  • !string searches for a command beginning with "string"
  • !?string searches for a command containing with "string"

Upvotes: 1

Related Questions