powerline icon indicating copy to clipboard operation
powerline copied to clipboard

Multiline prompt, no newline at end of "above" line.

Open crunk1 opened this issue 8 years ago • 6 comments

Hey all. I'm new here, so forgive me if this isn't an issue. I'm trying to set up a multiline prompt and I'm running into a few problems. FYI, I'm using zsh.

  1. I have an "above" list in my segments list, but the cursor starts at the end of the right segments (the last character on the row). After one character, the rest of the characters follow on the next line. For example: screenshot from 2016-10-28 17 32 55

This happens no matter what width the terminal is.

  1. If you compare the screenshot with my config below, I'm supposed to have a hostname segment in the above left. It is not showing up.
  2. You can also see that the mode and last_pipe_status segments (which are supposed to be in left and right, respectively) aren't showing up either.

Here is my .config/powerline/mine.json:

{
    "segments": {
        "above": [
            {
                "left": [
                    {
                        "function": "powerline.segments.common.net.hostname",
                        "priority": 10,
                    },
                    {
                        "function": "powerline.segments.common.env.user",
                        "priority": 30,
                    },
                    {
                        "function": "powerline.segments.common.env.virtualenv",
                        "priority": 50
                    },
                    {
                        "function": "powerline.segments.shell.cwd",
                        "priority": 10,
                        "args": {
                            "use_path_separator": true,
                            "dir_shorten_len": 1,
                            "dir_limit_depth": 10,
                            "shorten_home": true
                        }
                    },
                    {
                        "function": "powerline.segments.shell.jobnum",
                        "priority": 20
                    },
                    {
                        "function": "powerline.segments.shell.continuation"
                    }
                ],
                "right": [
                    {
                        "function": "powerline.segments.common.vcs.branch",
                        "priority": 40,
                        "args": {
                            "status_colors": true
                        }
                    },
                    {
                        "function": "powerline.segments.common.time.date",
                        "name": "time",
                        "args": {
                            "format": "%H:%M:%S",
                            "istime": true
                        }
                    },
                    {
                        "function": "powerline.segments.common.time.date",
                        "args": {
                            "format": "%A, %d %B %Y"
                        }
                    }
                ]
            }
        ],
        "left": [
            {
                "function": "powerline.segments.shell.mode"
            }
        ],
        "right": [
            {
                "function": "powerline.segments.shell.last_pipe_status",
                "priority": 10
            }
        ]
    }
}

crunk1 avatar Oct 29 '16 00:10 crunk1

hostname is not supposed to show up with this configuration, by default it is automatically disabled unless ssh is detected. above part is missing a filler segment (e.g. see vim statusline configuration). Also mode is not supposed to show up unless you are either using one of vi* keymaps or set default argument to something that is different from your current keymap (e.g. "args": {"default": "xxx_nonexistent_keymap_xxx"}.

Basically you do not have a multiline prompt, you have a single above line. Though there still is a bug: a single above line should result in an empty prompt below, not above line used as a below line.

ZyX-I avatar Oct 29 '16 11:10 ZyX-I

A single above line works fine when zpython is used. But when it is not used PS1 looks like PS1='$(…)' and expansion of $() eats all trailing newlines.

ZyX-I avatar Oct 29 '16 12:10 ZyX-I

I'm having a similar problem 11b32c1a922282f890b9275940a2c26dff2014e6

Is it related to the same bug or should I open a new ticket?

croxarens avatar Oct 31 '16 15:10 croxarens

@Croxarens Your problem has absolutely nothing to do with this issue. Also it is already known: #1652.

ZyX-I avatar Oct 31 '16 15:10 ZyX-I

@ZyX-I thanks the answer ;)

croxarens avatar Oct 31 '16 15:10 croxarens

hostname is not supposed to show up with this configuration, by default it is automatically disabled unless ssh is detected. above part is missing a filler segment (e.g. see vim statusline configuration). Also mode is not supposed to show up unless you are either using one of vi* keymaps or set default argument to something that is different from your current keymap (e.g. "args": {"default": "xxx_nonexistent_keymap_xxx"}.

Basically you do not have a multiline prompt, you have a single above line. Though there still is a bug: a single above line should result in an empty prompt below, not above line used as a below line.

I'm facing the same issue, and I cannot find anything about filler in the whole repo. could anyone provide an example here?

nrobert13 avatar Feb 10 '22 11:02 nrobert13