Commit Graph
167 Commits
Author SHA1 Message Date
Kovid Goyal 6546c1da9b run pyupgrade to upgrade the codebase to python3.6 2021-10-21 12:43:55 +05:30
Kovid Goyal 8057c420d9 Fix resize-os-window slightly incorrect on high DPI
Caused by premature clamping of a floating point number
2021-10-12 19:40:02 +05:30
Kovid Goyal 85db87a121 A shader to draw a single seven segment number over a kitty window 2021-10-11 11:13:29 +05:30
Kovid Goyal 3bc7b5bad9 Remote file transfer: Fix transfer not working is custom ssh port or identity is specified on the SSH command line
Fixes #4067
2021-09-27 10:58:40 +05:30
Kovid Goyal aafd8a8da4 When expanding vars allow using $$ for literal $ 2021-08-31 17:24:19 +05:30
Kovid Goyal 42dcecde14 More work on file transmission 2021-08-22 13:01:43 +05:30
Kovid Goyal 5a92d3f312 Fix a regression that broke the edit action in the remote file kitten 2021-08-13 16:59:40 +05:30
Kovid Goyal 5a47e0d2e4 Make reload_conf_in_all_kitties re-useable 2021-08-08 09:38:29 +05:30
Kovid Goyal 6f83f76d41 Make reading shell environment a bit more robust
Now ensure that --login flag is not duplicated. Also
run the shell in --interactive as well as --login mode.
2021-07-29 11:12:09 +05:30
Kovid Goyal 419cf78984 A new remote control command to resize OS Windows 2021-07-25 22:57:00 +05:30
Kovid Goyal 00828cb804 More reloading work for various options 2021-06-07 09:30:15 +05:30
Kovid Goyal 6d7df1c5e8 Refactor configuration file parsing
Now the time for importing the kitty.config module has been halved, from
16ms from 32ms on my machine. Also, the new architecture will eventually
allow for auto generating a bunch of python-to-C boilerplate code.
2021-05-31 17:40:49 +05:30
Kovid Goyal f7db9e3527 Move deprecated parsers into utils 2021-05-31 17:40:48 +05:30
Kovid Goyal 09093c8f3e Cleanup PR 2021-05-30 12:47:00 +05:30
Fredrick Brennan 3041ff8d25 Downgrade libstartup-notification-1.so non-existence to warning
I'm not sure how common this library actually is. On my system, an Arch
Linux system with 2,170 packages installed, including KDE (Plasma), I
didn't have it.

It's downgraded to a warning instead of printing a traceback.
2021-05-30 03:05:42 -04:00
Kovid Goyal b169831810 remove unused import 2021-05-25 09:00:54 +05:30
Kovid Goyal fe94f4cbb4 Move type parsers for config into own module 2021-05-24 22:29:28 +05:30
Kovid Goyal 1e6fe7785a Dont set the EDITOR env var in child processes
It isnt really needed, since the various kittens dont rely on it
anymore, instead calling get_editor() to get the path to the editor.
Has the nice side-effect of not needing to run the shell at startup
to read its environment. Now the shell is only run if the user calls
the edit config file kitten. Fixes #3426
2021-03-29 11:56:48 +05:30
Kovid Goyal 7eb8e1df79 Use importlib to load the shaders 2021-02-16 10:23:18 +05:30
Kovid Goyal fe07306ff1 Use a nicer decorator for functions that only need to be run once 2021-02-05 10:40:52 +05:30
Kovid Goyal 0e483f81ac Compat for python < 3.8 2021-02-05 09:23:54 +05:30
Kovid Goyal af94e07618 Cache exe lookups 2021-02-04 11:36:59 +05:30
Kovid Goyal 9cf5348c36 Modify ImageMagick wrapper to handle animated images 2021-02-01 14:12:26 +05:30
Kovid Goyal c1b7023e3a Look in ~/.local/bin preferentially 2020-12-29 11:50:11 +05:30
Kovid Goyal 65361d56c4 Use find_exe() for resolving editor as well
Avoids having to exec the shell in most cases
2020-12-29 11:33:42 +05:30
Kovid Goyal a7e9030c12 Make finding ImageMagick a bit more robust on macOS 2020-12-29 10:48:26 +05:30
Kovid Goyal c440470276 Entry point to edit config file 2020-11-04 16:30:29 +05:30
Kovid Goyal be1ff61e4a Improve some utility functions
Make expandvars accept both $VARNAME and ${VARNAME} now matches
the behavior of posixpath.expandvars

Allow overriding the environment variables to_cmdline expands against
2020-09-18 13:25:59 +05:30
Kovid Goyal be29c4a243 Move class definition to utils so can be used from multiple kittens easily 2020-09-15 10:34:37 +05:30
Kovid Goyal ace152d8a3 DRYer 2020-07-24 08:41:55 +05:30
Kovid Goyal a0d6445dda Move expandvars to utils 2020-05-05 08:22:08 +05:30
Kovid Goyal 2458c3a7c6 Implement drag and drop of text/plain for Wayland as well 2020-03-19 13:28:21 +05:30
Kovid Goyal 382c31ddf2 Use a stub rather than TYPE_CHECKING 2020-03-15 13:27:40 +05:30
Kovid Goyal d3f37eeba4 more typing work 2020-03-14 11:42:05 +05:30
Kovid Goyal b6692849d6 more typing work 2020-03-12 14:52:11 +05:30
Kovid Goyal ce94a9b2df More typing work 2020-03-11 09:35:59 +05:30
Kovid Goyal c817ba9eae more typing work 2020-03-09 13:32:45 +05:30
Kovid Goyal afec07b124 More typing work 2020-03-06 14:19:46 +05:30
Kovid Goyal 77e9460eea Make mypy a bit stricter 2020-03-05 19:57:28 +05:30
Kovid Goyal 0f4e7921ee Create an auto-generated stub file for the kitty Options object 2020-03-04 19:14:50 +05:30
Kovid Goyal f0b29e15c3 The utils and constants modules are now fully typechecked 2020-03-04 10:26:41 +05:30
Kovid Goyal 3b36470e84 When resolving scrollback pager if it is not present in system PATH try using shell PATH 2020-02-03 08:03:35 +05:30
Luflosi 527ff0238a Replace all instances of EnvironmentError with OSError
According to the text just above https://docs.python.org/3/library/exceptions.html#EnvironmentError, `EnvironmentError` has been an alias of `OSError` since Python 3.3. Replacing it makes the code more consistent since `OSError` is used in other places in the code too.
2020-01-11 16:47:36 +01:00
Kovid Goyal 9edad62144 hints kitten: Allow using named groups in the regular expression. The named groups are passed to the invoked program for further processing. 2019-11-11 17:34:19 +05:30
toonn a64a0d64cb Prefer VISUAL to EDITOR
Fix #2096
2019-10-25 18:52:17 +02:00
Luflosi 5f855ce547 Use context managers to open files
Inspired by https://github.com/kovidgoyal/calibre/commit/d50a6ddc1b71a575283e344a0d7bc539539bc5d1.
2019-08-01 13:21:26 -05:00
Luflosi 5143b62a07 Add kakoune to the list of editors 2019-07-20 01:07:10 +02:00
Kovid Goyal 277f43aed6 Linux: Disable the Wayland backend on GNOME
GNOME has no support for server side decorations.
Can be controlled by new option linux_display_server.
2019-06-04 19:10:13 +05:30
Luflosi 2b095f720e Use "with suppress()" to suppress python exceptions
Using
```Python
with suppress(OSError):
    os.remove('somefile.tmp')
```
instead of
```Python
try:
    os.remove('somefile.tmp')
except OSError:
    pass
```
makes the code more compact and more readable IMO.

This pattern was recommended by Raymond Hettinger, a Python Core
Developer in his talk "Transforming Code into Beautiful, Idiomatic Python" at https://www.youtube.com/watch?v=OSGv2VnC0go. The transcript is available at https://github.com/JeffPaine/beautiful_idiomatic_python
2019-06-03 12:27:43 +02:00
Luflosi a792c94ccf Use python3 shebang for all python scripts
Fixes #1624.
Use python3 shebang for all python scripts as python still defaults to python2 on many systems.
2019-05-20 14:44:24 +02:00