Skip to content
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

[Feature] Module for screen session #283

Open
andrzejnovak opened this issue Feb 1, 2021 · 5 comments · May be fixed by #286
Open

[Feature] Module for screen session #283

andrzejnovak opened this issue Feb 1, 2021 · 5 comments · May be fixed by #286

Comments

@andrzejnovak
Copy link

It would be very convenient to have :)

@CWempe
Copy link
Contributor

CWempe commented Apr 10, 2021

I have not tested this fully, but you can use the STY environment variable for this where the screen session name/id is stored.

function _update_ps1() {
    PS1="$($GOPATH/bin/powerline-go -error $? -jobs $(jobs -p | wc -l) \
         -cwd-mode plain \
         -colorize-hostname \
         -numeric-exit-codes \
         -shell-var STY \
         -shell-var-no-warn-empty \
         -modules time,venv,user,host,shell-var,cwd,perms,git,hg,jobs,exit )"
}
  • -shell-var STY displays the screen session name/id
  • -shell-var-no-warn-empty does show nothing if the variable does not exist
  • -modules [..] shell-var includes the variable in the output

Without screen:

image

see: #276

Inside a screen session:

image

@andrzejnovak
Copy link
Author

@CWempe I've put a PR for this some time back, but nice to know it could also be solved without. The one downside for me is that including both id and name is fairly long

@CWempe
Copy link
Contributor

CWempe commented Apr 11, 2021

I agree. A dedicated module would be best.
I do not like the bright yellow either. 😆

Maybe you could add an option to your PR to show/hide the id?
I barely use screen, but maybe it would make sense for some users to also see the id if there are multiple screen sessions with the same name.
I don't know if anybody would need this. 😉

@andrzejnovak
Copy link
Author

Can you pass options to modules or would it have to be a separate module?

Admittedly I don't know if anyone uses screen with just the number id's,

@CWempe
Copy link
Contributor

CWempe commented Apr 11, 2021

Can you pass options to modules or would it have to be a separate module?

I don't know. I assumed so. 😄
Aren't there other powerline-go arguments that are specific to modules?

Admittedly I don't know if anyone uses screen with just the number id's,
No, but there might be cases where there are two sessions named 1234.test and 5678.test.
So you would need the id to differentiate there sessions.

But maybe nobody cares.
You can still implement this after somebody asks for this feature. 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants