174 Commits

Author SHA1 Message Date
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
Kovid Goyal
c9644039b1
Merge branch 'add_option_to_not_switch_to_previous_when_closing_current_tab' of https://github.com/ddddavidmartin/kitty 2019-04-03 14:23:14 +05:30
David Martin
34de072a10 Add option to disable switching to the previous tab when closing the current one.
When setting tab_bar_switch_to_previous_when_closing_current_tab kitty
will now switch to the left tab instead of the previously active one
when the currently active tab is closed. This makes the closing of tabs
a bit more predictable.

Note that we are not touching the handling of the active_tab_history at
all. I was considering it, but we want to keep track of it in any case
to keep the 'switch to previous tab' shortcut working.
2019-04-03 19:27:04 +11:00
Kovid Goyal
971c28ce97
Fix tab title not always being updated when active window is closed 2019-03-21 20:44:55 +05:30
Kovid Goyal
56864cdfb7
When a window is closed, switch focus to the previously active window (if any) instead of picking the previous window in the layout
Fixes #1450
2019-03-09 10:42:55 +05:30
Kovid Goyal
e6d5eea7eb
Get rid of glfw_post_empty_event as it is not needed 2019-03-04 19:52:45 +05:30
Kovid Goyal
c385532b10
A new option :opt:tab_bar_min_tabs to control how many tabs must be present before the tab-bar is shown
Fixes #1382
2019-02-15 09:47:22 +05:30
Kovid Goyal
50a6abaac1
Also fix move_tab to preserve existing tab order 2019-01-04 06:59:38 +05:30
Kovid Goyal
4e7498b854
Fix using the `new_tab !neighbor` action changing the order of the non-neighboring tabs
Fixes #1256
2018-12-23 08:45:34 +05:30
Kovid Goyal
2367fad90b
Merge branch 'resize-window-cfg' of https://github.com/eepp/kitty 2018-12-19 11:05:31 +05:30
Philippe Proulx
d22686da10 Add resize_window configuration action
This patch adds the `resize_window` configuration action, which has the
following arguments:

1. Quality of resize amongst `wider`, `narrower`, `taller`, and
   `shorter` (mandatory).
2. Increment in number of cells (optional, default: 1).

This makes it possible to configure keys as such:

    map ctrl+shift+left resize_window narrower
    map ctrl+shift+right resize_window wider
    map ctrl+shift+up resize_window taller
    map ctrl+shift+down resize_window shorter

and have a behaviour which is somewhat close to Terminator's.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
2018-12-18 20:33:21 -05:00
Kovid Goyal
e113e0cba7
Allow hiding the tab bar completely, by setting :opt:tab_bar_style to `hidden`.
Fixes #1014
2018-10-25 10:05:43 +05:30
Kovid Goyal
62fe392041
Handle overlay windows when recording window history 2018-10-21 11:56:23 +05:30
Kovid Goyal
097d11819b
Add a new `nth_window action that can be used to go to the nth window and also previously active windows, using negative numbers. Similarly, goto_tab` now accepts negative numbers to go to previous windows
Fix #1040
2018-10-21 10:59:06 +05:30
Kovid Goyal
093c05e16a
When running kitty @ ls also output the current layout for each tab 2018-10-12 18:19:50 +05:30
Kovid Goyal
e4033d997c
Merge branch 'prev_' of https://github.com/Luflosi/kitty 2018-09-22 17:28:53 +05:30
Luflosi
bc38357193
Add prev_tab and prev_window as aliases for previous_tab and previous_window 2018-09-22 13:24:51 +02:00
Kovid Goyal
5fb02c0439
When mapping the new_tab action allow specifying that the tab should open next to the current tab instead of at the end of the tabs list
Fixes #979
2018-09-19 19:43:41 +05:30
Kovid Goyal
e39635ea16
Add a new `neighboring_window` function to switch to neighboring windows in the current layout, similar to window movement in vim
Fixes #916
2018-09-08 08:59:11 +05:30
Kovid Goyal
f0357b061e
Add a new `last_used_layout` function that can be mapped to a shortcut to switch to the previously used window layout
Fixes #870
2018-09-08 05:56:02 +05:30
Kovid Goyal
d276317e3a
Remote control: Allow changing the current window layout with a new goto-layout command
Fixes #845
2018-08-30 10:23:20 +05:30
Kovid Goyal
8b02b89bd6
Add an is_focused field to the output of kitty @ ls 2018-08-23 16:07:26 +05:30
Kovid Goyal
e35c3cc913
Add an option single_window_margin_width to allow different margins when only a single window is visible in the layout
Fixes #688
2018-06-29 09:56:05 +05:30
Kovid Goyal
53ae5a4f8d
A new tab bar style 2018-06-06 13:27:15 +05:30
Kovid Goyal
5674dc5bfc
... 2018-06-02 20:24:37 +05:30
Kovid Goyal
1b9c5522fb
Move tab bar into its own module 2018-06-02 20:22:27 +05:30
Kovid Goyal
adccc8fea4
When closing a tab switch to the last active tab instead of the rightmost tab. Fixes #585 2018-05-29 08:06:33 +05:30
Kovid Goyal
9eb113802d
Add a setting to control the margins to the left and right of the tab bar
Fixes #584
2018-05-28 21:59:45 +05:30
Kovid Goyal
a42bc3bf8c
oops 2018-05-27 12:37:49 +05:30
Kovid Goyal
523aadaa3b
Refactor font group handling
Allow kitty to manage multiple groups of fonts with different cell
sizes. Will eventually allow kitty to have different font sizes/dpi per
OSWindow
2018-05-27 12:37:05 +05:30
Kovid Goyal
05ec174868
@resize-window now has a useful return code 2018-05-18 00:01:31 +05:30
Kovid Goyal
8ea84c97d5
Use an overlay window for window resizing
Also implement a remote command to resize windows
2018-05-17 23:26:41 +05:30
Kovid Goyal
190612d507
Make the resize step size configurable 2018-05-17 16:48:35 +05:30
Kovid Goyal
e053d1f566
Implement resizing of individual windows in a layout
See the Layouts section in the README for details. Fixes #362

Note that it is only implemented for the Tall layout currently. Other
layouts to follow. The implementation might also be refined in the
future.
2018-05-17 15:09:41 +05:30
Kovid Goyal
4dcbb1f077
Avoid needless re-allocation of Layout objects on layout change
Also allows layout instance data to be preserved when cycling layouts
2018-05-16 16:24:31 +05:30
Kovid Goyal
3fdf47c535
Allow specifying the width of the tall window in the Tall layout as a percentage of available space
Also remove the --window-layout option as it was redundant. Same effect
can be achieved using -o enabled_layouts=some_layout,*
2018-05-16 14:02:58 +05:30
Kovid Goyal
dec1203ea8
Make the kitty window id available as the environment variable KITTY_WINDOW_ID
Fixes #532
2018-05-10 08:52:28 +05:30
Kovid Goyal
86686bfac7
Avoid rendering tab bar more than once per tick 2018-05-03 17:00:18 +05:30
Kovid Goyal
8d51edec17
Option to disable bell symbol on tab 2018-05-02 22:05:38 +05:30
Kovid Goyal
f2afba2ef4
Change the window border color if a bell occurs in an unfocused window. Can be disabled by setting the bell_border_color to be the same as the inactive_border_color. 2018-05-02 22:02:45 +05:30
Kovid Goyal
efcd3a5df7
Show a bell on the tab if a bell occurs in one of the windows in the tab and the window is not the currently focused window. Fixes #514 2018-05-02 21:44:14 +05:30
Kovid Goyal
2a52acdef4
Fix tab title not changing to reflect the window title when switching between different windows in a tab 2018-05-02 21:07:45 +05:30
Kovid Goyal
eadfeeec9b
Fix window focus gained/lost events not being reported to child programs when switching windows/tabs using the various keyboard shortcuts. 2018-05-02 20:50:42 +05:30
Kovid Goyal
9cacfc0c26
macOS: When the macos_titlebar_color is set to background change the titlebar background to match the current background color of the active kitty window 2018-05-01 23:37:48 +05:30
Kovid Goyal
040ae75c77
Remote control: Allow matching windows by number (visible position).
Fixes #501
2018-04-28 11:00:42 +05:30
Kovid Goyal
759aaf294a
Remove extra level of indirection in creating iterator 2018-04-28 10:39:59 +05:30
Kovid Goyal
98c04fb7da
Pass some common option values to the kittens 2018-04-12 13:21:05 +05:30
Kovid Goyal
b64bceac7f
Add a keyboard shortcut to open the kitty shell 2018-04-06 14:59:13 +05:30
Kovid Goyal
1fd84612a8
Add a remote control command to change colors
Also add a FAQ entry about changing colors in a running kitty instance.
I'm tired of all the bug reports asking for this feature. Apparently,
people find it hard to google for the existing escape codes based
solution.
2018-04-02 10:45:52 +05:30