rdnetto / powerline-hs

A lightning fast reimplementation of the Powerline prompt generator in Haskell.
Apache License 2.0
117 stars 7 forks source link

powerline-hs does not properly handle lack of RHS prompt configuration #4

Open exallium opened 7 years ago

exallium commented 7 years ago
Error in $: The key "right" was not found when parsing
/Users/ahart/Library/Python/2.7/lib/python/site-packages/powerline/config_files/themes/powerline.json
/Users/ahart/Library/Python/2.7/lib/python/site-packages/powerline/config_files/themes/shell/__main__.json
/Users/ahart/Library/Python/2.7/lib/python/site-packages/powerline/config_files/themes/shell/default_leftonly.json
/Users/ahart/.config/powerline/themes/powerline.json
/Users/ahart/.config/powerline/themes/shell/__main__.json
/Users/ahart/.config/powerline/themes/shell/default_leftonly.json
CallStack (from HasCallStack):
  error, called at src/Main.hs:160:23 in main:Main
exallium commented 7 years ago

My initial thought is that ConfigSchema.ForBothSides should expect Maybe a instead of a for left and right values, since they are optional (at least in python version)

rdnetto commented 7 years ago

Sorry for my delay in replying to this. I've pushed some changes which I believe should fix this (as well as a bunch of other similar problems). Would you mind checking them out and seeing if they fix it for you?

exallium commented 7 years ago

Hey, thanks for the response. I'll check the fix out later this morning and get back to you. Thanks.

exallium commented 7 years ago

@rdnetto

Hey, got this error after stack install

Progress: 2/4HttpExceptionRequest Request {
  host                 = "s3.amazonaws.com"
  port                 = 443
  secure               = True
  requestHeaders       = []
  path                 = "/hackage.fpcomplete.com/package/ReadArgs-1.2.3.tar.gz"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 ConnectionTimeout

Might be a network condition, I'll try again in a bit (unless you happen to know otherwise)

Edit: Looks like AWS is having issues, I'll check it again once AWS is stable.

rdnetto commented 7 years ago

AWS issues should be resolved now, try giving it another go.

exallium commented 7 years ago

Setting shell config to default_leftonly

: command not found
: command not found4:54},
-bash: 13:44:5413:44:54"cwd":: command not found
-bash: 13:44:5413:44:5413:44:54"args":: command not found
-bash: 13:44:5413:44:5413:44:5413:44:54"ellipsis":: command not found
: command not found4:5413:44:54}
: command not found4:54},
: command not found
-bash: 13:44:5413:44:54"line_current_symbol":: command not found
-bash: 13:44:5413:44:5413:44:54"contents":: command not found
: command not found4:54},
-bash: 13:44:5413:44:54"player":: command not found
-bash: 13:44:5413:44:5413:44:54"args":: command not found
-bash: 13:44:5413:44:5413:44:5413:44:54"state_symbols":: command not found
-bash: 13:44:5413:44:5413:44:5413:44:5413:44:54"fallback":: command not found
-bash: 13:44:5413:44:5413:44:5413:44:5413:44:54"play":: command not found
-bash: 13:44:5413:44:5413:44:5413:44:5413:44:54"pause":: command not found
-bash: �h: command not found
: command not found
-bash: 13:44:5413:44:5413:44:5413:44:5413:44:54"stop":: command not found
: command not found4:5413:44:5413:44:54}
: command not found4:5413:44:54}
: command not found4:54},
: command not found
-bash: 13:44:5413:44:54"time":: command not found
-bash: 13:44:5413:44:5413:44:54"before":: command not found
Error in $: The key "right" was not found when parsing merged JSON from:
InlineFile "themes/powerline.json" "{
13:44:54"dividers": {
13:44:5413:44:54"left": {
13:44:5413:44:5413:44:54"hard": "\238X~ ",
13:44:5413:44:5413:44:54"soft": "\238X "
13:44:5413:44:54},
13:44:5413:44:54"right": {
13:44:5413:44:5413:44:54"hard": " \238X\178",
13:44:5413:44:5413:44:54"soft": " \238X\179"
13:44:5413:44:54}
13:44:54},
13:44:54"spaces": 1,
13:44:54"segment_data": {
13:44:5413:44:54"branch": {
13:44:5413:44:5413:44:54"before": "\238Xp "
13:44:5413:44:54},
13:44:5413:44:54"stash": {
13:44:5413:44:5413:44:54"before": "�l "
13:44:5413:44:54},

13:44:5413:44:54"powerline.segments.common.net.network_load": {
13:44:5413:44:5413:44:54"args": {
13:44:5413:44:5413:44:5413:44:54"recv_format": "�z] {value:>8}",
13:44:5413:44:5413:44:5413:44:54"sent_format": "�z\ {value:>8}"
13:44:5413:44:5413:44:54}
13:44:5413:44:54},
13:44:5413:44:54"powerline.segments.common.net.hostname": {
13:44:5413:44:5413:44:54"before": "\238Xr "
13:44:5413:44:54},
13:44:5413:44:54"powerline.segments.common.bat.battery": {
13:44:5413:44:5413:44:54"args": {
13:44:5413:44:5413:44:5413:44:54"full_heart": "�ku",
13:44:5413:44:5413:44:5413:44:54"empty_heart": "�ku",
13:44:5413:44:5413:44:5413:44:54"online": "�lq\239\184b",
13:44:5413:44:5413:44:5413:44:54"offline": " "
13:44:5413:44:5413:44:54}
13:44:5413:44:54},
13:44:5413:44:54"powerline.segments.common.sys.uptime": {
13:44:5413:44:5413:44:54"before": "�]e  "
13:44:5413:44:54},
13:44:5413:44:54"powerline.segments.common.mail.email_imap_alert": {
13:44:5413:44:5413:44:54"before": "�n_ "
13:44:5413:44:54},
13:44:5413:44:54"powerline.segments.common.env.virtualenv": {
13:44:5413:44:5413:44:54"before": "�g\148  "
13:44:5413:44:54},
13:44:5413:44:54"powerline.segments.common.wthr.weather": {
13:44:5413:44:5413:44:54"args": {
13:44:5413:44:5413:44:5413:44:54"icons": {
13:44:5413:44:5413:44:5413:44:5413:44:54"day":           "�\128]",
13:44:5413:44:5413:44:5413:44:5413:44:54"blustery":      "�le",
13:44:5413:44:5413:44:5413:44:5413:44:54"rainy":         "�j\148",
13:44:5413:44:5413:44:5413:44:5413:44:54"cloudy":        "�j\129",
13:44:5413:44:5413:44:5413:44:5413:44:54"snowy":         "�o[",
13:44:5413:44:5413:44:5413:44:5413:44:54"stormy":        "�j^",
13:44:5413:44:5413:44:5413:44:5413:44:54"foggy":         "�_q",
13:44:5413:44:5413:44:5413:44:5413:44:54"sunny":         "�j\188",
13:44:5413:44:5413:44:5413:44:5413:44:54"night":         "�j\190",
13:44:5413:44:5413:44:5413:44:5413:44:54"windy":         "�j\180",
13:44:5413:44:5413:44:5413:44:5413:44:54"not_available": "\239\191\189",
13:44:5413:44:5413:44:5413:44:5413:44:54"unknown":       "�lp"
13:44:5413:44:5413:44:5413:44:54}
13:44:5413:44:5413:44:54}
13:44:5413:44:54},
13:44:5413:44:54"powerline.segments.common.time.fuzzy_time": {
13:44:5413:44:5413:44:54"args": {
13:44:5413:44:5413:44:5413:44:54"unicode_text": true
13:44:5413:44:5413:44:54}
13:44:5413:44:54},

13:44:5413:44:54"powerline.segments.vim.mode": {
13:44:5413:44:5413:44:54"args": {
13:44:5413:44:5413:44:5413:44:54"override": {
13:44:5413:44:5413:44:5413:44:5413:44:54"n":  "NORMAL",
13:44:5413:44:5413:44:5413:44:5413:44:54"no": "N\194\183OPER",
13:44:5413:44:5413:44:5413:44:5413:44:54"v":  "VISUAL",
13:44:5413:44:5413:44:5413:44:5413:44:54"V":  "V\194\183LINE",
13:44:5413:44:5413:44:5413:44:5413:44:54"^V": "V\194\183BLCK",
13:44:5413:44:5413:44:5413:44:5413:44:54"s":  "SELECT",
13:44:5413:44:5413:44:5413:44:5413:44:54"S":  "S\194\183LINE",
13:44:5413:44:5413:44:5413:44:5413:44:54"^S": "S\194\183BLCK",
13:44:5413:44:5413:44:5413:44:5413:44:54"i":  "INSERT",
13:44:5413:44:5413:44:5413:44:5413:44:54"R":  "RPLACE",
13:44:5413:44:5413:44:5413:44:5413:44:54"Rv": "V\194\183RPLC",
13:44:5413:44:5413:44:5413:44:5413:44:54"c":  "COMMND",
13:44:5413:44:5413:44:5413:44:5413:44:54"cv": "VIM\194\183EX",
13:44:5413:44:5413:44:5413:44:5413:44:54"ce": "NRM\194\183EX",
13:44:5413:44:5413:44:5413:44:5413:44:54"r":  "PROMPT",
13:44:5413:44:5413:44:5413:44:5413:44:54"rm": "-MORE-",
13:44:5413:44:5413:44:5413:44:5413:44:54"r?": "CNFIRM",
13:44:5413:44:5413:44:5413:44:5413:44:54"!":  "!SHELL"
13:44:5413:44:5413:44:5413:44:54}
13:44:5413:44:5413:44:54}
13:44:5413:44:54},
13:44:5413:44:54"powerline.segments.vim.visual_range": {
13:44:5413:44:5413:44:54"args": {
13:44:5413:44:5413:44:5413:44:54"CTRL_V_text": "�\149{rows} �\148{vcols}",
13:44:5413:44:5413:44:5413:44:54"v_text_oneline": "�\148{vcols}",
13:44:5413:44:5413:44:5413:44:54"v_text_multiline": "�\149{rows}",
13:44:5413:44:5413:44:5413:44:54"V_text": "�]\149{rows}"
13:44:5413:44:5413:44:54}
13:44:5413:44:54},
13:44:5413:44:54"powerline.segments.vim.readonly_indicator": {
13:44:5413:44:5413:44:54"args": {
13:44:5413:44:5413:44:5413:44:54"text": "\238Xr"
13:44:5413:44:5413:44:54}
13:44:5413:44:54},
13:44:5413:44:54"powerline.segments.vim.modified_indicator": {
13:44:5413:44:5413:44:54"args": {
13:44:5413:44:5413:44:5413:44:54"text": "+"
13:44:5413:44:5413:44:54}
13:44:5413:44:54},

13:44:5413:44:54"powerline.segments.i3wm.scratchpad": {
13:44:5413:44:5413:44:54"args": {
13:44:5413:44:5413:44:5413:44:54"icons": {
13:44:5413:44:5413:44:5413:44:5413:44:54"fresh": "�ic",
13:44:5413:44:5413:44:5413:44:5413:44:54"changed": "�i\139"
13:44:5413:44:5413:44:5413:44:54}
13:44:5413:44:5413:44:54}
13:44:5413:44:54}
13:44:54}
}
"
InlineFile "themes/shell/__main__.json" "{
13:44:54"segment_data": {
13:44:5413:44:54"hostname": {
13:44:5413:44:5413:44:54"args": {
13:44:5413:44:5413:44:5413:44:54"only_if_ssh": true
13:44:5413:44:5413:44:54}
13:44:5413:44:54},
13:44:5413:44:54"cwd": {
13:44:5413:44:5413:44:54"args": {
13:44:5413:44:5413:44:5413:44:54"dir_limit_depth": 3
13:44:5413:44:5413:44:54}
13:44:5413:44:54}
13:44:54}
}
"
InlineFile "themes/shell/default_leftonly.json" "{
13:44:54"segments": {
13:44:5413:44:54"left": [
13:44:5413:44:5413:44:54{
13:44:5413:44:5413:44:5413:44:54"function": "powerline.segments.common.net.hostname",
13:44:5413:44:5413:44:5413:44:54"priority": 10
13:44:5413:44:5413:44:54},
13:44:5413:44:5413:44:54{
13:44:5413:44:5413:44:5413:44:54"function": "powerline.segments.common.env.user",
13:44:5413:44:5413:44:5413:44:54"priority": 30
13:44:5413:44:5413:44:54},
13:44:5413:44:5413:44:54{
13:44:5413:44:5413:44:5413:44:54"function": "powerline.segments.common.env.virtualenv",
13:44:5413:44:5413:44:5413:44:54"priority": 50
13:44:5413:44:5413:44:54},
13:44:5413:44:5413:44:54{
13:44:5413:44:5413:44:5413:44:54"function": "powerline.segments.common.vcs.branch",
13:44:5413:44:5413:44:5413:44:54"priority": 40
13:44:5413:44:5413:44:54},
13:44:5413:44:5413:44:54{
13:44:5413:44:5413:44:5413:44:54"function": "powerline.segments.shell.cwd",
13:44:5413:44:5413:44:5413:44:54"priority": 10
13:44:5413:44:5413:44:54},
13:44:5413:44:5413:44:54{
13:44:5413:44:5413:44:5413:44:54"function": "powerline.segments.shell.jobnum",
13:44:5413:44:5413:44:5413:44:54"priority": 20
13:44:5413:44:5413:44:54},
13:44:5413:44:5413:44:54{
13:44:5413:44:5413:44:5413:44:54"function": "powerline.segments.shell.last_status",
13:44:5413:44:5413:44:5413:44:54"priority": 10
13:44:5413:44:5413:44:54}
                ]
13:44:54}
}
"
UserFile "themes/powerline.json"
UserFile "themes/shell/__main__.json"
UserFile "themes/shell/default_leftonly.json"
CallStack (from HasCallStack):
  error, called at src/Config/File.hs:52:22 in main:Config.File
rdnetto commented 7 years ago

Well, that looks horribly broken. Can you run powerline-hs --version for me, just to make sure I'm looking at the right code?

Also, you can test it without breaking your prompt by just running stack build, then running .stack-work/install/x86_64-linux-tinfo6-nopie/lts-8.3/8.0.2/bin/powerline-hs (exact path may differ)