Skip to content

terminal emulator Notes

chris edited this page Jan 20, 2022 · 8 revisions

Contents

Working with iTerm2

iTerm2 Gotchas

When messing around with locale settings make sure,

  • Set locale variables automatically

is set, within the Terminal under the Profiles tab.

If the above setting isn't set within iTerm2 locale settings have been know to get jacked. πŸ‹οΈβ€β™€οΈ

Both iTerm2 and Terminal.app get their locale settings from AppleLocale

The AppleLocale setting can be statused with

defaults read -g AppleLocale

iTerm2 Useful Links

Working with Hyper

Hyper Useful Links

Working with Alacritty

i need emojis, ...what i can say

i spent the afternoon brushing up some git skillz, just so i could finally insert an emoji #forfuckssake using alacritty. long story short, somebody had already got the emoji input menu working on macos (god bless your soul & your time).

https://github.com/alacritty/alacritty/pull/3561

that pr was never merged into the upstream master branch of alacritty (WHATTTTEVERRR).

there have been several open issues about getting the emoji/input pickers going with alacritty but none have been implemented upstream. decided to rebase the PR ontop of the current git master so i can insert emojis in alacritty and when i type markdown docs using neovim yay πŸ™Œ.

Working with different font sizes within Alacritty. The font size within a terminal can be adjusted using meta + or meta -. Keep in mind the actual font size or adjusted font size can not be printed to the terminal or read from the active terminal session. A possible work around is to open another terminal with the below command

alacritty -v

Then adjust the font size similiar to the previous terminal, and look for the font size printed to STDOUT, and then divide that font size by 2.

Upgrading Alacritty on macOS

To update Alacritty on macOS there are two binaries that need to be updated.

  1. To update Alacritty.app
cd /path/to/alacritty/git/src
git pull upstream master
git push origin master
make app
cp -r target/release/osx/Alacritty.app /Applications

To update /usr/local/bin/alacritty

cargo install --git https://github.com/jwilm/alacritty

To update the completions for fish shell

cd /path/to/alacritty/git/src
cp -r alacritty-completions.fish $__fish_datadir/vendor_completions.d/alacritty.fish

Alacritty does not provide any scrollback support out of the box, a useful work around is to use tmux.

Alacritty does not provide a way to create a new window.

If a connection to a remote server is broken due to network loss, ie. a SSH session is terminated unexpectedly, the hung SSH session can be terminated gracefully with, ⌘ + shift + .

However running the above key sequence could render the terminal unusable due to mouse clicks not properly being sent to the terminal emulator, thus try reseting the terminal

alacritty-broken-pipe-mouse-click

reset

To update Alacritty using cargo

cargo install --git https://github.com/jwilm/alacritty

Alacritty Key Bindings

To setup a meta key binding, ie. alt + [ALPHA_KEY], as far as I can tell, any of the alpha keys on the keyboard can be used, i.e A through z. All that is required is to do something like,

alacritty.yml

key_bindings:
- { key: [ALPHA_KEY],        mods: Alt,     chars: "\x1b[ALPHA_KEY]"                       }

Substitute [ALPHA_KEY] with a key of A through z on the keyboard.

Ex

key_bindings:
- { key: Q,        mods: Alt,     chars: "\x1bq"                       }

The example above adds a keybinding for alt + q

Alacritty Gotchas

If the correct font is not properly set in the alacritty.yml file within the $XDG_CONFIG_HOME Alacritty will fail to launch.

To use a font family with spaces in the name, ie. IBM Plex make sure to quote the name of the font family, ie. "IBM Plex"

To list and search for a particular font on macOS

fc-match -a | grep -i "[mr-fancy-search-string-within-font-family-name]"

The font family name is listed with double quotes when outputted to STDOUT with the above command.

Alacritty > determine current size of window

alacritty -v

After alacritty has been launched certain outputs can determine the current window / PTY size of the window on macOS.

  • Width & Height
  • Cell Size

Divide the width by the first listed Cell Size and that is the ~ PTY dimension of Column

Useful Links

Useful Links my dotfiles wiki

TODOs

  • time permitting do some research on auto resizing termnial windows based on the width of the output
Clone this wiki locally