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
multi-line shell #462
Comments
I can deduce some hacks to make it work, but here is another proposal: use # Theme file
{
"segments": {
"above": [
{
"left": [
# First line left segments
],
"right": [
# First line right segments
]
},
{
# Same for second line
}
],
"left": [
# Usual last line segments
],
"right": [
# Usual last line right segments
]
}
} (used YAML syntax to allow comments) where output will look like
@Lokaltog, how does this feel? |
It could work pretty well. I think a more elegant solution could be to just have |
There are two reasons why I have it this way:
This way it would be better to somehow select last line, I prefer the above. We are still not having configuration proposed previously (don’t remember where) about reserving some width for typed text (neither we have working truncation in shells: because sides are computed separately). It would be natural if option for this only existed in a special line and unnatural if it was valid only for last one. † Unless we want to support multiline statusline patch that is created by some Japanese (AFAIR) vim user group. By the way, there is a way to display prompt below cursor, though I guess there will be big problems with rendering (zsh also has a bunch of data like completion to display below prompt and it is needless to say you can easily write script that extends on more then one line). |
You make a good point, I agree with your initial suggestion. |
It seems like @treyhunner's solution for a separate line for the prompt no longer works. Here is the minimal configuration I used to test:
Here is the result on the command line: I do not understand why the control-J (^J) character is in there. |
-----BEGIN PGP SIGNED MESSAGE----- On June 23, 2014 2:15:13 AM GMT+03:00, Chris Lasher notifications@github.com wrote:
That solution was exploiting a bug that is no longer present. And you are wrong: CTRL-J character is not present there: control characters are not displayed in the terminal. If you are asking why NL is replaced with '^J' then the answer is simple: because NL is CTRL-J. iQJNBAEBCgA3BQJTp1t/MBwfMDI7PjIgHTg6PjswOSAQOzU6QTA9NEA+MjhHIDxr |
There is no mention of the bug or its side effect anywhere else in this issue. That's fine though. So what's the new way to tell Powerline's shell component, "break the line"? I want to put my prompt on a separate line than the information in the Powerline segments, as described at http://agperson.com/entry/4081. How do I do this, if the newline in "after" is now considered a bug exploit?
Fine, Powerline displays a "caret followed by a capital J", not a literal "Control-J", in lieu of a newline character. Based on the existing documentation I had to find by web searches, one of which led me to here, "caret followed by a capital J" was not the expected behavior. |
If there was this issue would be closed. Currently there is no way to have multiline prompt. |
@gotgenes Check out new |
Note: I was testing my branch with {
"default_module": "powerline.segments.common",
"segment_data": {
"hostname": {
"before": " ",
"args": {
"only_if_ssh": true
}
},
"virtualenv": {
"before": "ⓔ "
},
"branch": {
"before": " "
}
},
"segments": {
"above": [
{
"left": [
{
"name": "cwd"
},
{
"type": "string",
"highlight_group": "cwd",
"draw_soft_divider": false,
"draw_hard_divider": false,
"width": "auto"
}
],
"right": [
{
"name": "user"
}
]
}
],
"left": [
{
"module": "powerline.segments.shell",
"name": "mode"
},
{
"name": "hostname"
},
{
"name": "user"
},
{
"name": "virtualenv"
},
{
"name": "cwd",
"args": {
"use_path_separator": true,
"ellipsis": "…",
"dir_limit_depth": 3
}
},
{
"module": "powerline.segments.shell",
"name": "jobnum"
}
],
"right": [
{
"module": "powerline.segments.shell",
"name": "last_pipe_status"
},
{
"name": "branch"
}
]
}
} in |
Why make "above" a special case; why not just make segments itself an array with objects containing "left" and/or "right"? Objects are rendered in order of appearance in the array as separate lines, from first to last. Using your example above:
|
-----BEGIN PGP SIGNED MESSAGE----- On June 23, 2014 10:38:10 AM GMT+03:00, Chris Lasher notifications@github.com wrote:
You should read this issue from top, your question was already answered.
-----BEGIN PGP SIGNATURE----- iQJNBAEBCgA3BQJTp9p+MBwfMDI7PjIgHTg6PjswOSAQOzU6QTA9NEA+MjhHIDxr |
Fair enough. |
Support is not mirrored in shell bindings yet
I've looked and looked, and can't for the life of me figure out how can I have this on 2 lines. |
Thank you. |
To achieve a two-line shell prompt I tried adding the following to "segment_data" for the shell configuration but it resulted in the triangle being placed on the next line.
Result:
The text was updated successfully, but these errors were encountered: