Commit graph

238 commits

Author SHA1 Message Date
Kovid Goyal
4a71afaf96
Get rid of --debug-config
Instead have a keybind that shows the configuration used
by the currently running kitty instance
2021-06-05 14:27:24 +05:30
Kovid Goyal
4cff3e51cb
macOS: Add a global menu entry to reset the terminal 2021-06-05 10:12:44 +05:30
Kovid Goyal
d264c3d91e
typo 2021-06-05 10:10:23 +05:30
Kovid Goyal
93e9d3cb5f
Fix a crash on exit on macOS
Calling Python API functions is not allowed in atexit handlers.

Fixes #3686
2021-06-03 11:54:55 +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
Luflosi
4a67af9b90
macOS: add menu items for new_window and close_window 2021-05-25 13:54:02 +02:00
Kovid Goyal
253b219d67
Store the options object globally 2021-05-24 11:50:03 +05:30
Kovid Goyal
cbf33fa14b
Fix #3523 2021-04-23 16:23:13 +05:30
Kovid Goyal
36da65120a
It's only alt and alt+shift that dont work in global menubar
alt in combination with ctrl/cmd works fine.
2021-04-22 10:50:43 +05:30
Kovid Goyal
b9210a2ba4
macOS: Prevent option based shortcuts for being used for global menu actions
Fixes #3515
2021-04-22 10:15:10 +05:30
Kovid Goyal
850a8218db
Allow toggling xdg configure debug output at runtime 2021-04-07 15:24:58 +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
81f144df15
macOS: Add entries to global menu bar for creating and changing tabs 2021-02-25 11:54:53 +05:30
Kovid Goyal
52347ced85
macOS: Make the global keybinding used for preferences also configurable 2021-02-25 06:58:20 +05:30
Kovid Goyal
36ca3838a6
Fix #3265 2021-01-27 17:19:06 +05:30
Kovid Goyal
5a2f2767ad
Fix window icon not working on X11 with 64bits
Apparently on X11 the maximum icon size is 128x128. 256x256 is too
large for the X11 protocol because the X server unserializes the icons
using "unsigned long" which is 64 bits on Linux. So we have to use
64bits per pixel instead of 32, with 32bits padded to 0.

While there I also got rid of the kitty.rgba file replacing it with a
128x128 PNG file.

Fixes #3260
2021-01-25 20:54:19 +05:30
Kovid Goyal
aa63bf71cf
macOS: Add menu items to close the OS window and the current tab
Fixes #3246
2021-01-17 06:49:25 +05:30
Kovid Goyal
027c5a57f1
Work on porting kittens to use new key infrastructure
Also move type definitions into their own module
2021-01-16 20:52:14 +05:30
Kovid Goyal
b94d2b27f4
Refactor single key config parsing to use a special type 2021-01-07 18:07:17 +05:30
Kovid Goyal
175ff4b955
DRYer 2020-12-29 11:36:30 +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
4c4f6983d1
Fix env LC_CTYPE=UTF-8 not working on macOS 2020-11-30 16:23:29 +05:30
Kovid Goyal
55e15dc79e
Properly type check os window initial size function
Also use the sizes specified int he session file in preference to those
specified on the command line. Fixes #2909
2020-08-11 09:28:53 +05:30
Kovid Goyal
a0d6445dda
Move expandvars to utils 2020-05-05 08:22:08 +05:30
Kovid Goyal
85b55b31b6
Add a new :opt:listen_on option in kitty.conf
Also allow using environment variables in this option
Fixes #2569
2020-04-19 09:23:52 +05:30
Kovid Goyal
85c40090ed
Fix #2570 2020-04-19 08:36:29 +05:30
Alexander Kobel
e6e61028b1 Rename --debug-gl to --debug-rendering 2020-04-14 19:35:40 +02:00
Kovid Goyal
cfe9b408ce
Move startup of first child out of the constructor of Boss 2020-03-19 16:48:16 +05:30
Kovid Goyal
917559f883
more typing work 2020-03-13 16:13:26 +05:30
Kovid Goyal
0e871a89aa
more typing work 2020-03-11 09:57:49 +05:30
Kovid Goyal
308d171dae
More typing work 2020-03-08 18:55:30 +05:30
Kovid Goyal
9b32f18109
Refactor remote control commands into individual modules
Also add type information
2020-03-08 08:39:26 +05:30
Kovid Goyal
f05890719d
Add type checking for the various CLI options objects 2020-03-05 15:47:12 +05:30
Kovid Goyal
64b497589f
Start adding typing info 2020-03-03 14:31:25 +05:30
Kovid Goyal
b54ffbefe4
Ignore setlocale() failures on Linux as well
There are apparently some Linux systems that manage to bork their
locales out there. So just go on with the C locale on these systems.
2020-02-22 18:13:49 +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
edacdc5e25
Use python context manager to open file 2020-01-16 14:11:54 +01:00
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
ee7a5eef99
Have read_shell_environment() not fail when no shell is present 2019-12-27 12:25:01 +05:30
Kovid Goyal
7bed66a458
Ensure ans is set in read_shell_environment
Fixes #2232
2019-12-27 12:20:06 +05:30
Kovid Goyal
33c5fc0fb6
typo 2019-12-20 07:59:55 +05:30
Luflosi
1ae324691d
Change keyboard shortcut selection algorithm for new_os_window on macOS
On macOS the keyboard shortcuts are visible in the menu bar. When the keyboard shortcut is used, the corresponding menu bar item flashes to indicate which action was just executed.
kitty allows defining multiple keyboard shortcuts for the same action but macOS allows only one, so kitty needs to decide which one should be handled by macOS. Currently it chooses the first keyboard shortcut with only the command key as a modifier key or the first shortcut when there are no shortcuts with only the command key as a modifier.
When a user tries to set their own keyboard shortcut (and doesn't use `clear_all_shortcuts yes`), this won't change the shortcut displayed in the menu bar since the first (default) shortcut with the command key is <kbd>⌘</kbd>+<kbd>n</kbd>.
I think simply choosing the last defined keyboard shortcut is better. This will even allow the user to specify modifier keys other than the command key while still changing the shortcut in the menu bar. This change will not change the default behaviour because all the macOS specific keyboard shortcuts are defined after the non-macOS specific ones.
2019-12-19 22:15:41 +01:00
Kovid Goyal
c510584afd
Dont hang trying to read shell environment if the shell never quits. Fixes #2143 2019-11-20 11:53:28 +05:30
Kovid Goyal
54ca775006
Merge branch 'visual' of https://github.com/toonn/kitty 2019-10-26 09:10:15 +05:30
toonn
a64a0d64cb Prefer VISUAL to EDITOR
Fix #2096
2019-10-25 18:52:17 +02:00
Luflosi
505ed5e43b
Fix crash when the shell takes too long to start when reading the environment
According to https://docs.python.org/3/library/subprocess.html#subprocess.Popen.wait, `wait()` throws a `TimeoutExpired` exception when the process is not done after the timeout. I noticed this because kitty crashed for me.
The old code looks like it's trying to wait as long as it takes for the process to finish, which is what I implemented.
2019-08-01 02:03:08 -05:00
Kovid Goyal
bdade7e151
Use a new controlling terminal when reading shell environment
This is because some people do things in their rc files based
on checking the name of the controlling terminal.
2019-07-31 11:34:54 +05:30
Kovid Goyal
6958ded4c4
Dont fail to start if running the shell to read the EDITOR env var fails
Fixes #1869
2019-07-31 06:37:17 +05:30
Kovid Goyal
88f25ccc76
Also handle non-absolute paths being used for $EDITOR 2019-07-22 10:30:11 +05:30
Kovid Goyal
50e7351c73
When detecting the EDITOR from the environment, if the EDITOR env var is not present, try to read it from the shell's rc files by executing a login shell and dumping its environment
macOS makes it unreasonably hard to set system-wide environment
variables, so this hack might be useful there.
2019-07-22 09:29:55 +05:30