How to undo split panels in iTerm2? [closed] - macos

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
I've started using iTerm2. I like the functionality of splitting panels using
Cmd + d
and
Cmd + Shift + d
But how can I undo this splitting?
In the standard terminal Cmd + d can be undone using Cmd + Shift + d, but in iTerm it's used for horizontal split.

I like the functionality of splitting panels using Cmd + d
Note that whilst this even in iTerm2's official docs is described as Split Panes
Split Panes
iTerm2 allows you to divide a tab into many rectangular "panes", each of which is a different terminal session. The shortcuts cmd-d and cmd-shift-d divide an existing session vertically or horizontally, respectively. You can navigate among split panes with cmd-opt-arrow or cmd-[ and cmd-]. You can "maximize" the current pane--hiding all others in that tab--with cmd-shift-enter. Pressing the shortcut again restores the hidden panes.
if you only start with a single terminal session, the splitting comes with the side effect of starting another session. As per the docs, you can either maximize a single pane using
Cmd + Shift + Enter
which leaves the hidden panes alive as active terminal sessions. Moreover, you can kill the terminal session of the active pane using
Cmd + w
Which comes with the iTerm2 side effect that the corresponding pane will also be closed.
Note that repeated use of Cmd + w will, after closing all terminal sessions, eventually close the final terminal session and the iTerm2 tab itself.
Example of Cmd + w to close terminal session (with the effect of closing the panes that used to hold them):

Related

New colors for highlighting text in mac preview [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
There are only 5 colors in mac preview to highlight your text.
Does anyone know any way to add more colors to this? or at least to change a couple of them.
These colors are too dark for me for highlighting!!!
Thanks
There is a way, but it may be a little more troublesome.
You can click on the icon located on the top right of the preview
window that looks like a briefcase. A toolbar will pop up.
Click on
the 3rd icon in the new toolbar. It auto-straightens your drawn line
if it is pretty straight.
Colour options are the in the third last
icon. There are many many options. To make it semi-transparent like a highlight, just need to click "Show colors" and adjust the "Opacity" slider in the Color window.
Lastly, the thickness of the line
as a highlight can be controlled in the fourth-last icon.
Speed tips:
To make it faster to highlight multiple lines, you can click your
first highlight, Control-C to copy it, then Control-V to paste it.
This eliminates the need to redraw every time. Just need to move it
to your next highlighting line.
If you have a whole block that
you need to highlight, you can copy a previous block, say of 3
lines, and paste it, then drag it to the new area. To do this, you
just have to select the first highlight, press and hold the Shift
key, and select the next 2 highlights. Then Control-C and Control-V
as before.
If you're highlighting a block for the first time, you can draw or move a previously copied highlight on to the last line of your block. Then, once you copy your new highlight, pasting it each time subsequently will automatically paste it one line higher than the previous. For this to work, you will have to copy right after you paste your new line.
(Ctrl-C, Ctrl-V, Ctrl-C, Ctrl-V, etc.)
Note for pasting in a different page:
After you Control-C the highlight(s), click on the new page, and then Control-V.

1. Shell and 1.bash on top of iTerm window? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
when I open Iterm, the top of the window says 1. Shell and then quickly changes to 1.bash.
Can anyone tell me what they mean? And is it possible to change the title on the top? Thanks!
iTerm has several options for altering the text within the title bar. Select iTerm -> Preferences from the menu and then select Appearance. You will see three options related to the the title bar under Window & Tab Titles:
Show window number (checked by default)
Show current job name (checked by default)
Show profile name (unchecked by default)
The 1. is the window number. If you open multiple windows using the menu bar, Shell -> New Window or the shortcut Command-N, this number will increment for each window you open. Closing a window won't force a renumber, but the lowest available number will be used when you open a new window.
The current job name is the command the terminal is currently executing. When waiting for input, it displays the shell, bash in your case. If you execute a command, say sleep 10, it will display sleep since that is the command currently executing. Once the command ends, it will display bash again. It takes a second to update so it won't change for commands that execute quickly.
bash is the name of your command shell. bash is the default command shell, but you can change it if you wish (I personally use zsh). As noted above, this is the current job if no other command is executing.
Yes, you can change the title bar. You can use an ASCII escape sequence and the echo command (be sure to type this exactly):
echo "\033];Hello World\007"
will place the text Hello World in the title. Note that when you set title bar contents in this manner, the current job is placed in parenthesis. After executing the echo, my title bar displays:
1. Hello World (zsh)
Most people set the title bar as part of a custom prompt. This allows the title bar to update after each command and display useful information such as the current working directory. For example, see https://apple.stackexchange.com/questions/90725/for-iterm2-how-do-i-make-the-working-directory-appear-in-the-window-title and https://superuser.com/questions/79972/set-the-title-of-the-terminal-window-to-the-current-directory for details on putting the current working directory in the title bar.

Mac OS X Terminal [Use option as meta key] overrides backslash in spanish keyboard [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
I check "Use option as meta key" checkbox in Mac OS X Terminal, because I like to use emacs way of moving between words: M-f & M-b.
But if I do that, I can't get the backslash (Option + º; i.e.: Option + key-at-the-left-of-1-in-spanish-keyboard).
If I uncheck it, then I can input the backslash, but I don't have M-f & M-b.
Is there a way to get both?
The escape key works as a meta key by default; no need to use option as the meta key (other than its more convenient location).
Not a great solution, but XTerm (running in X11 on OS X) can use CMD as the Meta key.
You might also have some good results from KeyRemap4MacBook.
Just as a side benefit, XTerm should also give you proper terminal mouse interaction, e.g. in Emacs or ncurses based apps.
You will most likely run into a lot more problems with that setup, because Mac OS uses "Alt" as a modifier in a lot of shortcuts. But anyway, including the following line in your ~/.bash_profile will send a backslash if you enter the unicode character "∫" (which is E288AB):
bind '"\033\xE2\x88\xAB"':'"\\"'
You could customize the keyboard map to use a different key for entering backslash. Look in
Preferences > Settings > [profile] > Keyboard
For example, you could map Control-F1 to backslash.
Note that the default keyboard map maps Option-Left/Right Arrow to M-b/f, so you could use those instead of using Option for Meta (you’d have to get used to using the arrow keys instead of b and f, but I’ve never been able to get used to using b and f and prefer the arrow keys).
I had the same issue. This is how I solved it.
I replaced the built in terminal with iTerm2, which also gave me a few other nice features. To get a sane Meta-key i did the following:
For the profile I wanted to use I checked "Alt sends +Esc", which gave me back a sane Meta-key that works in Emacs, Bash and others. However, I did lose the backslash key. So, to get it back and added a binding in the profile that does "Send text: \" and then I bound it to my backspace key combo (Shift-Alt-7, I'm Norwegian).
Now I have M-f, M-b in Emacs, M-. in Bash and I'm able to send backslashes. I also have a "Visor shell session" that I can have slide down by pressing another key combination.
This is years late, but for people coming across this page whilst searching for a solution, as I did, I have decided to build one myself.
It is a simple status bar app that runs in the background and rewrites all left-Alt + $KEY key events to two key events in rapid succession, Esc, then $KEY; however, it only does this if Terminal.app is the focused application.
You can find it here at https://github.com/habibalamin/Metalt.

How do I get the behaviour of the 'Insert' key on VIM using a Macbook Pro without an insert key? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
Because the apple store couldn't help me, and indeed had never seen VIM before, despite the fact it comes installed as standard on OSX ;-).
With iTerm or iTerm2 you can map an unused key to insert. For example, I've mapped F19 to "send escape sequence" [2~ (that's the xterm escape sequence for the insert key).
In iTerm2, go to preferences, "Bookmarks", select the "Keyboard" tab, click the "+", press the key you want to map, select action "send escape sequence" and then enter [2~.
Surely you can just do a simple:
inoremap <C-l> <Insert>
I can't say I've ever had to use replace mode enough that <Esc>R wasn't quick enough for me.
You can use i instead of insert.
Taken from here:
Toggling insert mode
Press Ctrl-Space to start and to stop insert mode (the same suggestion using Shift-Space is above):
nnoremap i imap
Or you may prefer to map Ctrl-Space to a rather than i so that repeatedly pressing Ctrl-Space does not move the cursor back (remember that pressing I allows you to insert a character at the beginning of the line):
nnoremap a imap
You would put this in your .vimrc so it happens on start-up.
Either use Mac's onscreen keyboard or use a hotkey program to rebind one of your existing keys to Insert. One Superuser thread provides several Autohotkey equivalents for Mac such as Quicksilver.

Is it possible to select a specific tab in OSX Terminal.app using keyboard shortcuts? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I know I can cycle through my tabs using cmd+{ or cmd+}, but is it possible to select a specific tab (i.e. cmd+3 for the third tab in iTerm) in Leopards' Terminal.app?
This is an option. Tab Switching in Terminal
Yes it is, you use Command-1, Command-2 etc.
Have a look under the Window menu, and you'll see the windows listed with their shortcut equivalent. (The 'clover-leaf' is the symbol for the Command key - also known as the Apple key.)
My apologies - missed the fact you were referring to Tabs first time around. I don't believe there is any other keyboard shortcut to switch between Tabs beyond Cmd-{ and }. Perhaps if that's important, don't group them in the first place? Leave them as separate windows?
I would highly suggest using GNU Screen if you really need tabs that much. I have a particular .screenrc file that makes life easier, just put the following in your home directory in a file called .screenrc:
defscrollback 1024
hardstatus on
hardstatus alwayslastline
hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a "
Also, when starting screen, I run screen -c ~/.screenrc.programming which looks like this:
source $HOME/.screenrc
screen -t World
screen -t Server
screen -t Console
screen -t Command
screen -t Editor
screen -t MySQL
This will open a bunch of 'tabs' that you can switch between using Ctrl-A,n and Ctrl-A,p or Ctrl-A followed by a number to switch directly to one.

Resources