Keybinding actions could be used as touchbar actions. That gives easy access to sending text, menu items, etc. Showing tabs in the touchbar is another obvious one. Maybe as an option to show it only in fullscreen?
By default, it provides an "ESC" key and Mute/VolDn/VolUp/Siri.
It is available to customize with application specific functions should the application support it.
I don't normally have MANY (<6) tabs open at the same time, but swapping through them like the "pictures" slider is cool. Perhaps a "specific" tab button or adding/removing tabs to a "featured" button (I would expect to set a "Featured" button, and then add/remove tabs from the "Featured" rotation; if only 1 tab, it's an instant swap, if 2+ tabs are added to "Featured", then it swaps between them much like hitting 'next').
In MacOS's native Terminal.app, the Touch Bar has a button that opens the man page for the command you're typing. For example, if I've typed doc (without finishing the command, mind you) it shows:
Pressing it opens a new window with the man page. For pv, for example:
iTerm doesn't have to do this, but I can see how it would be useful. Switching tabs (or even just showing info about the currently running process) could also be super useful.
IMO, this should be tied into the "Shell Integration"/"Inline Images" functionality - i.e. an escape sequence lets you specify button labels (UTF-8) + raw key sequences to send - that would get you pretty good flexibility to implement most of what's described above.
Then you could imagine plugins for e.g. screen/tmux to provide window switching, etc.
My personal opinion is that it should work like @dbushong said. It would be really cool if you could show custom commands on the bar via shell scripts / shell integration. It would be the next evolution of command prompt customization.
For example, I might want the bar to show my git branch name / edit status while I'm in a folder looking at a git project. But then if I run an editor, I might want to show editing-related commands (vim shortcuts, etc).
How awesome would it be to show your CI-status in the touch bar. Green bar when all tests are passing and red bar when there are issues (with a description of the failing spec inside?)
Using the Touch Bar to show statuses goes directly against Apple's guidelines.
Use the Touch Bar as an extension of the keyboard and trackpad, not as a display. Although technically it’s a screen, the Touch Bar functions as an input device, not a secondary display. The user may glance at the Touch Bar to locate or use a control, but their primary focus is the main screen. The Touch Bar shouldn’t display alerts, messages, scrolling content, static content, or anything else that commands the user’s attention or distracts from their work on the main screen.
When trying to start iterm nightly after the update with an older MBP (late 2012), the app closes immediately. When trying to start from terminal, I get the following error output:
/Applications/iTerm.app/Contents/MacOS/iTerm22016-11-28 12:12:17.346 iTerm2[649:13230] Try to connect to orphaned server at /var/tmp/iTerm2.socket.91332016-11-28 12:12:17.347 iTerm2[649:13230] Failed: Connection refused2016-11-28 12:12:17.476 iTerm2[649:13230] -[PseudoTerminal touchBar]: unrecognized selector sent to instance 0x7fe1d3308710[1] 649 illegal hardware instruction /Applications/iTerm.app/Contents/MacOS/iTerm2
Anything I can do to get iterm into working? Like disabling nightly and "downgrade"?
Adding a touchbar key to open a new profile item seems like a natural thing to do. Having all of the profiles already populated without having to do Prefs->keys->Add Touchbar item would be great. Not sure how to handle the "new window" vs "new tab" selection, though.
@marcuspoehls: I confirm the same problem. Late 2013 MacBook Pro Retina 15", MacOS 10.11.6. Last iTerm2 nightly that does not have the problem is iTerm2-3_0_20161122-nightly.zip Starting with the November 25th nightly, crash reporter says:
Exception Type: EXC_BAD_INSTRUCTION (SIGILL)Exception Codes: 0x0000000000000001, 0x0000000000000000Exception Note: EXC_CORPSE_NOTIFYApplication Specific Information:Crashing on exception: -[PseudoTerminal touchBar]: unrecognized selector sent to instance 0x7fa3d2c52400
I've had no issues with the nightly build. The touchbar feature is phenomenal. I'm mostly using it to manage some common shortcuts - is there a way to have it send a command instead of just entering text? Or, to enter text, but also send Return?
This works great in the latest nightly, thanks so much for the quick implementation of this feature!
Can I add another feature request? Would be nice if the open tabs were an option, and to hilight them on change/terminal bell as the tabs in the app do. Safari similarly implements tabs (with visual previews that are unusable!)
Could we have something so that applications running in the terminal can use the touch bar? For example curl could show a progress bar. My shell could show the current git branch, and/or predictions for tab expansion. My text editor could have a save button... Such kind of things...
Maybe this kind of things can be done using custom escape codes, just like the inline images feature of iTerm? TouchBar presses could emit key/scancodes that can be specified in de key definition?
To give an idea of what I'm thinking about is the following nonsens:
When I add a custom command through "Add Touch Bar item" it does not show up on the touch bar. In the picture @gnachman posted, I see everything except the Instant Replay button which I assume is a custom touch bar item, except for a button that has a Play Button and a plus. From what I can tell, it sets a mark which you can navigate with the Up and Down keys.
EDIT: I figured it out. You must go to View -> Customize Tool Bar...duh
@gnachman I have three remarks/questions about the TouchBar stack, first a crash, and second should it reset after a push?
First, using the TouchBar stack crashes iTerm (a crash reporter report has been sent by me):
$ ./it2setkeylabel.sh set F1 foo$ ./it2setkeylabel.sh push$ ./it2setkeylabel.sh set F1 bar$ ./it2setkeylabel.sh pop$ ./it2setkeylabel.sh set F1 crash
Second, one would push a TouchBar configuration on the stack because of a context switch, e.g., you switch from your shell to your text editor. Wouldn't it make sense to reset the function key labels to the defaults ([F1] [F2] ... [F20]) when you push?
Finally, would it be the right approach to make it the responsibility of the shell to push on the stack before starting a process and pop afterwards?
Thanks for letting me know about the crash. It's fixed now.
Second, one would push a TouchBar configuration on the stack because of a context switch, e.g., you switch from your shell to your text editor. Wouldn't it make sense to reset the function key labels to the defaults ([F1] [F2] ... [F20]) when you push?
would it be the right approach to make it the responsibility of the shell to push on the stack before starting a process and pop afterwards
No because programs can be suspended and many (all?) shells aren't capable of dealing with that. For example, you can give vim a string to output when it becomes active and another sequence to run when it ceases to be active (t_ti and t_te, respectively). You'd need to do push & set in t_ti and a pop in t_te.
Also, an update:
I've extended push and pop to take an optional "name" parameter to handle programs exiting unexpectedly in commit 65bca1e3. If ssh exits because of a network error you end up with a stack of unknown depth. By using unique names you can always pop back to a known state. You could use an ssh wrapper script like this:
#!/bin/bashNAME=ssh_$RANDOMit2setkeylabel.sh push $NAMEssh $*it2setkeylabel.sh pop $NAME
@pupaxxo You should use the name argument to PushKeyLabels and PopKeyLabels in case nano runs a subprocess that pushes key labels but doesn't pop them properly.
Is it possible for certain applications within iTerm (say, nano or vim) to expand the function keys when they're opened? (and then return them to the popover after quitting?). That would make the labels suuuper useful.
Might be tough, but when the tabs are displayed in the touch bar while in fullscreen, is there any way to color the touch bar tab text (like you color the tabs themselves using something like echo -n -e "\033]6;1;bg;green;brightness;96\a";)?
First, I was thinking of a way to set key background and text color (both optional) like SetKeyColor=F1=0082D8;FFFFFF. But probably, for consistency, it would be better to offer a set of predefined styles, such as: default, primary (blue background), disabled (grey text) SetKeyStyle=F1=primary?
But, even more than styling, I would like to be able to use fontawesome for icons :)
Can this functionality be extended so that it's possible to (re)label any custom touchbar item? I'd rather be able to add an item whose default action is 'Ignore' and then assign that to something, as opposed to having to use an Fn key.
@yankcrime Would you mind opening a new issue? This one has gotten a bit out of hand and it's too difficult to track individual feature requests. Thanks!
Any chance of making tabs in fullscreen an option? I typically only work in full screen with 1 tab (I use non-iterm tmux, I know) and would like to take advantage of some of the other functionality.
Any chance of making tabs in fullscreen an option
You can configure the touch bar items in View > Configure touch bar. Do it while in full screen to be able to remove the fullscreen tab bar.
My personal feeling is that you should just implement the pushd/popd using the it2setkeylabel approach like I did for the Fish shell (https://github.com/tader/touchbar_dirstack).
The it2setkeylabel is really flexible and will be context sensitive. (Your shell can set the labels and listen for the function keys, any application can set the labels and listen for the function keys.) What would happen to the breadcrumbs while you are working over SSH in your favorite text editor? Would they remain occupying valuable touchbar real estate? Would pressing them change your local or remote directory? Even while in an editor?
I love that there is now TouchBar support and that we can add new items but is there a way to remove some of the predefined items? Having an item on the TouchBar that changes its content and size while I'm typing (man page) kind of distracts me from work.
sorry, because of ignorance with both iTerm and vim I do not see how to
apply that gist to my case, can you say more what the gist does? thanks,
roberto