Commit Graph

71 Commits

Author SHA1 Message Date
Kovid Goyal
88091b4ab3 BASH integration: No longer modify .bashrc to load shell integration
I think I have things setup robustly so that the shell integration
is loaded transparently via env vars and the normal bash startup files
are sourced, in the same way that vanilla bash does it. Let's hope I
haven't overlooked something.
2022-02-22 21:24:51 +05:30
Kovid Goyal
7448789951 Improve CWD detection when there are multiple foreground processes in the TTY process group 2022-02-08 20:30:00 +05:30
pagedown
ba0f61d752 Refactor: More f-string for kitty 2022-01-29 20:17:46 +08:00
Kovid Goyal
70d5a5134f Log a nicer error message when failing to read cwd of a process 2021-12-22 16:22:33 +05:30
Kovid Goyal
32768e7939 Unify the PATH searching algorithm for launch and running children 2021-12-08 20:10:34 +05:30
Kovid Goyal
c8c6f8691f Store the shell_integration option as a set 2021-11-29 12:41:25 +05:30
Kovid Goyal
0c160eab7b Avoid needing to exec kitty to get manual shell integration 2021-11-08 11:37:50 +05:30
Kovid Goyal
8218df82f2 Add function to get path to integration script for the current shell
Makes setting up manual shell integration much easier. Also clean up
integration docs.
2021-11-08 11:11:16 +05:30
Kovid Goyal
35514e0cc3 Dont change XDG_DATA_DIRS for child processes in fish shell integration
Fixes #4199
2021-11-07 10:06:18 +05:30
Kovid Goyal
d090db380f Add more type annotations 2021-10-27 13:26:18 +05:30
Kovid Goyal
4494ddd8ff mypy: Turn on return value checks
Its a shame GvR is married to "return None"
https://github.com/python/mypy/issues/7511
2021-10-26 22:39:14 +05:30
Kovid Goyal
6546c1da9b run pyupgrade to upgrade the codebase to python3.6 2021-10-21 12:43:55 +05:30
Kovid Goyal
3cea8f24d4 ... 2021-10-02 04:58:47 +05:30
Kovid Goyal
5f32d2e56f Uppercase DELETE_ENV_VAR 2021-09-16 10:16:33 +05:30
Kovid Goyal
5b716df45f We dont need a special class for delete_env_var 2021-09-16 09:53:54 +05:30
Kovid Goyal
66e2e60ac4 Allow deleting environment vars from the child environment using env 2021-09-16 08:43:17 +05:30
Kovid Goyal
725ec57bee Automatically setup shell integration for ZSH 2021-08-18 10:06:06 +05:30
Kovid Goyal
b581408137 DRYer 2021-08-18 10:06:05 +05:30
Kovid Goyal
9e2590eb15 Set the KITTY_PID env var when running child processes 2021-08-07 16:48:34 +05:30
Kovid Goyal
c827a29a7b Use the new get_options() function
Nicer than carrying around opts objects everywhere
2021-05-24 12:29:11 +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
d173ab9f45 macOS: Fix the LC_TYPE env var being set to UTF-8 on systems in which the language and country code do not form a valid locale
Fixes #1233
2020-06-24 22:09:25 +05:30
Kovid Goyal
917559f883 more typing work 2020-03-13 16:13:26 +05:30
Kovid Goyal
8803eeb890 more typing work 2020-03-10 12:58:53 +05:30
Kovid Goyal
5bdb405635 More typing work 2020-03-09 08:56:02 +05:30
Kovid Goyal
cc1336a616 More typing work
Also use a mypy based linter when editing
2020-03-08 11:02:14 +05:30
Kovid Goyal
c9ce2f47dc No top level typing issues found in kitty package 2020-03-04 07:31:22 +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
6aa82d82ad Start work on a unified interface for launching processes 2019-11-13 09:58:28 +05:30
Kovid Goyal
54ad1d103a Fix #2087 2019-10-23 18:21:34 +05:30
Luflosi
6cc720a350 Fix typos
Inspired by 4d3ee554b3.
Found using `codespell`.
2019-08-26 12:31:15 +02:00
Luflosi
5f855ce547 Use context managers to open files
Inspired by d50a6ddc1b.
2019-08-01 13:21:26 -05:00
Kovid Goyal
5d22e07738 More details on login shell invocation 2019-07-31 12:20:02 +05:30
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
38f73b9f5e Fix #1832 2019-07-23 13:31:09 +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
Kovid Goyal
4e9dabfb25 Add an option :opt:command_on_bell to run an arbitrary command when a bell occurs
Fixes #1660
2019-05-29 09:42:52 +05:30
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
Kovid Goyal
f4294b83fb Add a rationale for PWD 2019-05-11 12:59:01 +05:30
Kovid Goyal
4fa4a20b22 When launching child process set the PWD environment variable
This allows shells to display the symlink path to a directory instead
of the resolved path, when the specified directory is a symlink. Fixes #1595
2019-05-11 12:57:25 +05:30
Kovid Goyal
718f7e77a1 Use the current working directory of the foreground process for the *_with_cwd actions that open a new window with the current working directory. 2019-01-03 13:29:52 +05:30
Kovid Goyal
c4aeb1adba Report the current foreground processes as well as the original child process, when using kitty @ ls 2019-01-03 13:14:39 +05:30
Kovid Goyal
e71c432b7c ... 2018-08-06 20:13:16 +05:30
Kovid Goyal
b6a5d09d4f Allow enabling remote control in only some kitty windows 2018-08-06 20:04:12 +05:30
Kovid Goyal
eb2ec1833c Use a pipe rather than a signal to wait for terminal ready
Simpler code, more robust since there is no longer a race between the
installation of the signal handler and the dispatch of the signal
2018-08-04 20:24:06 +05:30
Kovid Goyal
72e2307c16 Code to get the env vars of a process 2018-07-24 11:27:10 +05:30
Kovid Goyal
0dd3334811 Implement getting cmdline of process on macOS as well 2018-07-24 11:07:53 +05:30
Kovid Goyal
9918397190 Add an option :opt:env to set environment variables in child processes from kitty.conf 2018-07-15 12:16:43 +05:30
Kovid Goyal
d689c21283 Fix pasting large amounts of text very slow.
Fixes #682

Apparently when refactoring child.py I somehow lost the code to make the
child fd non-blocking.
2018-06-26 18:20:46 +05:30
Kovid Goyal
a1355484a6 Use the process name as the default window title rather than "kitty"
Fixes #610
2018-06-07 23:23:10 +05:30