Powerline: KeyboardInterrupt on very quick Ctrl-c Ctrl-c

Created on 24 Oct 2013  路  11Comments  路  Source: powerline/powerline

When pressing very quickly Ctrl-c Ctrl-c I get the following

Traceback (most recent call last):                                                                                                                 File "/home/user/.local/bin//powerline", line 8, in <module>
    from powerline.shell import ShellPowerline, get_argparser, finish_args
  File "/home/user/.local/lib/python2.7/site-packages/powerline/__init__.py", line 9, in <module>
    from powerline.lib.config import ConfigLoader
  File "/home/user/.local/lib/python2.7/site-packages/powerline/lib/__init__.py", line 3, in <module>
    import json
  File "/usr/lib/python2.7/json/__init__.py", line 108, in <module>
    from .decoder import JSONDecoder
  File "/usr/lib/python2.7/json/decoder.py", line 7, in <module>
    from json import scanner
  File "/usr/lib/python2.7/json/scanner.py", line 5, in <module>
    from _json import make_scanner as c_make_scanner
KeyboardInterrupt
cshell wontfix bug

All 11 comments

This will eventually be solved when we switch to daemon.

Has this been solved yet - is powerline using a daemon? Because I'm still having this problem occuring all the time.

Thanks

@welly There is a daemon. But powerline is not going to run this automatically for you, check out the instructions for shell bindings.

Ah brilliant, thank you. Found it.

@welly Can you post where have you found this info?

@pmalek I found powerline-daemon in my terminal and added it to my .zshrc file. More info was found here: http://powerline.readthedocs.org/en/latest/usage/shell-prompts.html

@ZyX-I Why isn't the daemon enabled by default? Had I not found this thread I was about to stop using this plugin because the error was popping up constantly. I didn't see it listed in known open bugs and I didn't think to look in the docs for a one liner fix like this because I assumed if there was a fix officially known and documented, it'd already be enabled by default.

@patrick-motard because powerline isn't enabled by default either.
You need to manually configure tools to use it (at least for all the bindings that require/use the daemon), and on the Configuration page that was linked there is are two big notes right there:

Powerline daemon is not run automatically by any of my bindings. It is advised to add

powerline-daemon -q

before any other powerline-related code in the shell configuration file.

On the other config pages this doesn't apply beecause the python API is used, except for tmux where the note appears again.

@s-ol My question comes from complete ignorance. I'm only looking at this from the perspective of a beginner with a strong preference towards ease of use and hope that some defaults could be made in some cases. I appreciate your answer and absolutely understand and agree with your points.

@patrick-motard well it is important to also check the documentation in this way, if no-one knows the daemon exists that is as much a bug as if it breaks.

Also I guess the shell bindings _could_ do a powerline-daemon -q themselves to kick it off if you don't.

@s-ol I think that's a great idea! I wouldn't imagine anyone wants to see stack traces by default. Assuming the daemon running without the users consent doesn't negatively impact the system I think it's a good idea.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

djbender picture djbender  路  24Comments

catskul picture catskul  路  11Comments

victorhck picture victorhck  路  11Comments

treyhunner picture treyhunner  路  16Comments

suoto picture suoto  路  31Comments