-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ikhal] add option to disable mouse, fixes #1289 #1295
Conversation
This is done by passing the `handle_mouse` Boolean argument to urwid's main loop (currently unused). By default, the mouse remains enabled (see `khal.spec`). Mouse can be disabled either by setting `enable_mouse = False` in the `[default]` section of khal's config file, or by passing the `--no-mouse` flag to the `khal interactive` or `ikhal` click commands.
@@ -19,3 +19,4 @@ env/ | |||
venv/ | |||
.hypothesis/ | |||
.python-version | |||
.dmypy.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added this because I'm using neovim with pylsp-mypy (with the dmypy daemon, which can create this file).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No objections on this.
Note that you can include this in ~/.config/git/ignore
and git will ignore the file for all your local repositories.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah thanks, did not know that. Good to know :)
khal/cli.py
Outdated
@@ -93,6 +93,12 @@ def multi_calendar_option(f): | |||
return d(a(f)) | |||
|
|||
|
|||
def no_mouse_option(f): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since I had to use this both for ikhal
and khal interactive
, I figured it made sense to abstract this option into its own function decorator.
khal/cli.py
Outdated
'''Interactive UI. Also launchable via `ikhal`.''' | ||
if no_mouse: | ||
ctx.obj['conf']['default']['enable_mouse'] = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm overriding the config value when the --no-mouse
flag is used. Not sure this is the best way, but seems to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks okay to me.
@WhyNotHugo i fixed the tests, can you trigger the CI build (sorry was busy with work and forgot this PR) |
Co-authored-by: Hugo <[email protected]>
@WhyNotHugo addressed your comments (sorry for not running the tests before), ran the tests locally and everything passes. i think you can trigger the CI again! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, looks good. I believe setting the default of the click flag to True messes with overriding the config variable (e.g. setting the default value to False is then overridden by the command flag). See comments.
@geier done! thanks for catching that |
looks like I didn't reload properly. |
Works, thanks! |
This is done by passing the
handle_mouse
Boolean argument to urwid's main loop (currently unused). By default, the mouse remains enabled (seekhal.spec
). Mouse can be disabled either by settingenable_mouse = False
in the[default]
section of khal's config file, or by passing the--no-mouse
flag to thekhal interactive
orikhal
click commands.fixes #1289