Mac terminal repeat…
 
Notifications
Clear all

Mac terminal repeating commands

3 Posts
4 Users
1 Likes
330 Views
0
Topic starter

How to make mac terminal to not repeat similar commands when using the up and down key.

2 Answers
1

To prevent Mac Terminal from repeating similar commands when using the up and down arrow keys, you can modify the shell history behavior by adding the following line to your shell configuration file (such as ~/.bashrc or ~/.zshrc):

export HISTCONTROL=ignoreboth

This setting will ignore duplicate commands and commands that start with a space, preventing them from showing up when navigating through command history using the up and down arrow keys. Remember to restart your Terminal or run source ~/.bashrc (or source ~/.zshrc for Zsh) for the changes to take effect.

aakashchamola aakashchamola 22/07/2023 6:15 am

@rivek-t this worked !
Thanks a lot

0
  1. Open the Terminal app found in /Applications/Utilities/
  2. At a fresh bash prompt, hit the Escape key twice.
  3. You will see a message stating “Display all 1460 possibilities? ( …
  4. Hit the Return key to scroll through the huge list of commands available.
Share: