iTerm2 beta adds Python API
iterm2.com
iterm2.com
[1] https://github.com/kovidgoyal/kitty/issues/887#issuecomment-...
[1] https://github.com/jwilm/alacritty
Disclaimer: I am not associated with the project in any way. Just a fan.
> This appears to be an issue outside of terminal emulators; either macOS has an IPC performance issue, or either tmux or vim (or both) have a bug. This same issue can be seen in iTerm2 and Terminal.app. I've found that if tmux is running on another machine which is connected to Alacritty via SSH, this issue disappears. Actual throughput and rendering performance are still better in Alacritty.
There's an older HN thread [1] on the subject with benchmarks and lots of interesting chatter. It's worth a read IMHO.
Controlling my terminal emulators through a browser is like managing processes with Doom: something that, while interesting and certainly shouldn't be precluded, I am unable to think of a use case where I would actually do it. Making web sockets the scripting interface for a program that in most cases you do NOT want to actually expose to the web a) makes no sense; b) is a security incident waiting to happen.
Although, I clicked through the status bar stuff and now I can't figure out how to get it back :(
Then you can right click on the status bar to get to the editor.
Anyone found an off-button?
I switch between a 4K monitor and my built-in. The same font size definitely doesn’t work between the two of them. I’ve got a script in my .bashrc that checks the resolution of the current monitor and sets the Profile of the session using the older control-code based API, flipping between a profile for each monitor resolution.
With the new API, I can see methods for overriding profile settings on an individual session, but not a method for changing the profile a session is using to another saved profile. Does such a method exist?
What are the features in iTerm2 that you use the most?
Text selection is better and customizable. Makes it easier to select things like up addresses with a double click.
Hotkey window is just too damn convenient. I end up using it all the time when I just need to execute one-off commands.
It’s gonna sound super minor, but
-- Give Terminal the same toggle as iTerm 2
hs.hotkey.bind('ctrl', '`', function()
if hs.application.title(hs.application.frontmostApplication()) == "Terminal" then
hs.eventtap.keyStroke('cmd', 'h')
else
hs.application.launchOrFocus("Terminal.app")
end
end)
I’m not opposed to iTerm, but I needed a break from heavy customized environments for a bit and this was the one feature I needed to replicate.Clicking on links in the terminal is a nice feature. If you press cmd + click it opens your browser or finder. I occasionally enjoy this convenience.
There are probably other conveniences that don't come to mind now.
On Terminal.app you can cmd + double click to open a link on the browser. (it doesn't open a path on finder though)
Quake-like drop-down animation.
- Ability to create arbitrary handlers for mouse click actions
- Ability to save my configuration in version-controlled JSON
- Autocomplete
- Conventional full screen mode (not the weird MacOS thing that creates a new desktop)
- Grep for things that look like IP address and color them in blue, or errors in red
- Auto-Complete based on the text in terminal
- Broadcast same keypresses into several panes (having SSH sessions to several servers)
- Making an icon jump when a long running command just finished
- etc.etc.
I know people who returned their company-issued X1 Carbons and bought an out-of-pocket MacBooks just so they can use iTerm.
Who knew Electron apps could out perform native ones (even with GPU acceleration in iTerm2’s case)! I don’t know how or why but in this case it is so.
How are you measuring?
It seems a waste having to keep a battalion of imperative OO languages in one's head just for incidental use.
Not everything is done in a browser.
Likewise nobody says you need to be a full time developer in every language to get benefit from learning them.
I won’t deny that there is a short upskilling time where you need a quick refresher but that’s no different to picking up old code you’ve not touched in a while in a language you do use regularly. In fact often the time you spend familiarising yourself with an existing codebase or new API also serves as a catch up for the language too.
That said, I have personally found that it gets easier the more languages you learn because you get good at spotting similarities. Much like with spoken languages: people who are multilingual adapt to new languages quicker because they spot patterns to stuff they’ve learned previously.
Americans and Canadians, for example, usually find uncanny-valley differences between their nations that get washed out if you visit somewhere radically different instead. The small-magnitude “it could’ve been something else” realizations are just as important.
If you use a language with a similar paradigm, learning yet another language in that paradigm will not teach you much, it'll mostly just annoy you with its subtle differences (I'm talking to you, stored and mutable default variables of python functions).
These different designs will teach you different techniques for problem solving that can be borrowed in different languages when you’re trying to solve a problem that isn’t easily solved using its classic idiom.
Except perhaps Java and early C#. before Linq.
Not only that: embedding python is a shitty experience compared to embedding lua or guile, and you have to work around the fact that python has no threads and that it is borderline impossible to run multiple independent interpreters in the same process.
That's a "feature", they prefer for people to extend python over embedding it in other applications.
That said, it isn't too bad unless you maintain the python c-api binding by hand since there's a lot of boilerplate and they like to change the api often.
Almost all my blender hacking was on the python API and that's crazy complicated compared to a terminal emulator. For example, all of the (context sensitive) operators are callable from python since the UI is controlled by python scripts.
> ...and you have to work around the fact that python has no threads and that it is borderline impossible to run multiple independent interpreters in the same process.
Pretty sure python has threads;P and has had subinterpreters[0] for a long time. Haven't really messed with either one other than making sure my C extensions release the GIL though.
I did attempt to embed lua in an application once and from what I can remember it was...interesting. Having to control the stack took some getting used to and their boilerplate was just as full featured as python's. I also don't remember being able to find useful automation scripts, with python I usually just bang out a quick prototype with pybindgen then hand edit it until I'm happy.
[0] https://docs.python.org/3/c-api/init.html#sub-interpreter-su...