0

It's not quite autocomplete but on the ROS2 course on O'Reilly, the instructor types part of the command, presses Enter and the terminal shows any and all commands for which what has been typed before pressing Enter is a substring of the actual command.

Here is an example

autocomplete pic

cd /usr/share/col

gets him several that start like that and among them he chooses to type in

cd /usr/share/colcon_argcomplete...

... because he types in the subdirectory after that

How do I get this functionality on my terminal?

2
  • Usally TAB TAB shows the different possibilities for autocomplete.
    – Marco
    Jun 2, 2023 at 12:33
  • yck33@nyck33-VB-Ubu22ROS:~/ros2_ws$ history | g Display all 242 possibilities? (y or n) that does not really work. @Marco Jun 4, 2023 at 1:10

1 Answer 1

0

It's press TAB twice in quick succession, in my use case in the ROS2 course, I type

ros2 run my_py_pkg //tab twice now

giving me a list of executables that I can run with that command

nyck33@nyck33-VB-Ubu22ROS:~$ ros2 run my_py_pkg 

--prefix

py_node

robot_news_station

//then run the command I want

nyck33@nyck33-VB-Ubu22ROS:~$ ros2 run my_py_pkg robot_news_station


Not the answer you're looking for? Browse other questions tagged .