Don't flag this as duplicate to answers that say append \
because I am not asking for line continuation.
I want something equivalent to Command . from default terminal in ITerm2. I want to treat line as a comment.
Just want to go to a new line without executing. And I don't want to erase the command as well.
$ hello world
$ previous line was not executed and its still there without showing errors
$ ls -la
Best Answer
This has nothing to do with iTerm, but rather the shell that you're using and whether or not the option
interactive_comments
is enabled or not. To treat the line as a comment, you have to start the line with a comment character.Bash Reference Manual (Chapter 3.1.3) - Comments
To make this permanent, put the command in your
~/bash_profile
or~/bashrc
. It's enabled by default in BashZsh Reference Manual (Chapter 6.7) - Comments
To make the setting permanent, place the appropriate command in your
~/.zshrc
. It's disabled by default in Zsh.