If you live in the terminal, kitty is made for you! Cross-platform, fast, feature-rich, GPU based.
Oops, the num is already negative index, no need to reverse here.
Alternatively this is shorter:
```
def nth_os_window(self, num: int = 1) -> None:
if not self.os_window_map:
return
if num == 0:
os_window_id = current_focused_os_window_id() or last_focused_os_window_id()
elif num > 0:
ids = tuple(self.os_window_map.keys())
os_window_id = ids[min(num, len(ids)) - 1]
else:
fc_map = os_window_focus_counters()
ids = sorted(fc_map.keys(), key=fc_map.__getitem__, reverse=True)
os_window_id = ids[min(-num, len(ids)-1)]
focus_os_window(os_window_id, True)
```
|
||
|---|---|---|
| .github | ||
| bypy | ||
| docs | ||
| gen | ||
| glad | ||
| glfw | ||
| kittens | ||
| kitty | ||
| kitty_tests | ||
| logo | ||
| shell-integration | ||
| terminfo | ||
| tools | ||
| .editorconfig | ||
| .gitattributes | ||
| .gitignore | ||
| .ignore | ||
| __main__.py | ||
| Brewfile | ||
| build-terminfo | ||
| CHANGELOG.rst | ||
| CONTRIBUTING.md | ||
| count-lines-of-code | ||
| dev.sh | ||
| go.mod | ||
| go.sum | ||
| INSTALL.md | ||
| key_encoding.json | ||
| LICENSE | ||
| Makefile | ||
| mypy-editor-integration | ||
| publish.py | ||
| pyproject.toml | ||
| README.asciidoc | ||
| SECURITY.md | ||
| session.vim | ||
| setup.py | ||
| shell.nix | ||
| staticcheck.conf | ||
| test.py | ||
| update-on-ox | ||
= kitty - the fast, feature-rich, cross-platform, GPU based terminal See https://sw.kovidgoyal.net/kitty/[the kitty website]. image:https://github.com/kovidgoyal/kitty/workflows/CI/badge.svg["Build status", link="https://github.com/kovidgoyal/kitty/actions?query=workflow%3ACI"] https://sw.kovidgoyal.net/kitty/faq/[Frequently Asked Questions] To ask other questions about kitty usage, use either the https://github.com/kovidgoyal/kitty/discussions/[discussions on GitHub] or the https://www.reddit.com/r/KittyTerminal[Reddit community] Packaging status in various repositories: image:https://repology.org/badge/vertical-allrepos/kitty.svg?columns=3&header=kitty["Packaging status", link="https://repology.org/project/kitty/versions"]