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

Add Screen session section to prompt #1062

Merged
merged 9 commits into from Nov 9, 2022

Conversation

laendoor
Copy link
Contributor

@laendoor laendoor commented Aug 2, 2021

Description

Screen is a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells.

https://www.gnu.org/software/screen/

There is a similar PR open for this functionality (#906) but I think that PR hasn't enough information in bash script definition neither into documentation. It also hasn't enough customization.

For that reasons I open this PR in order to improve this project.

Screen defines a $STY env var with format pid.tty.host or pid.sessionname (if defined). So prompt information is shown only when a session is opened. That check is defined using a regex match /^[0-9]+/ against $STY env var. If $STY is empty or it doesn't match regex section returns before define local 'screen_session'.

But if you don't want to show session name you can disable it using SPACESHIP_SCREEN_SHOW_SESSION=false.

Screenshot

image

image

Using SPACESHIP_SCREEN_SHOW_SESSION=false

image

@netlify
Copy link

netlify bot commented Aug 2, 2021

Deploy Preview for spaceship-prompt ready!

Name Link
🔨 Latest commit dfcfa03
🔍 Latest deploy log https://app.netlify.com/sites/spaceship-prompt/deploys/636c15e0213a740008ed0a97
😎 Deploy Preview https://deploy-preview-1062--spaceship-prompt.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@laendoor laendoor force-pushed the screen-session branch 2 times, most recently from c6be0b6 to c844fa7 Compare August 2, 2021 03:27
Copy link
Member

@denysdovhan denysdovhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your section looks good. This is a good feature.

At the moment we have frozen adding new features until the work on #1056 is in progress. ETA is a few weeks.

sections/screen.zsh Outdated Show resolved Hide resolved
sections/screen.zsh Outdated Show resolved Hide resolved
@denysdovhan denysdovhan added frozen Progress is temporarily frozen until resolving the specific issue. new-feature A PR that implement feature (section, specific behavior, etc). review-required labels Aug 6, 2021
@denysdovhan denysdovhan removed the frozen Progress is temporarily frozen until resolving the specific issue. label Nov 9, 2022
Copy link
Member

@denysdovhan denysdovhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, I've taken care of this PR and refactored it to the latest master.

It's now renamed screen -> gnu_screen to make name more specific.

@denysdovhan denysdovhan enabled auto-merge (squash) November 9, 2022 21:05
@denysdovhan
Copy link
Member

Thanks for contributing!

@denysdovhan denysdovhan merged commit f996381 into spaceship-prompt:master Nov 9, 2022
denysdovhan pushed a commit that referenced this pull request Nov 10, 2022
# [4.10.0](v4.9.1...v4.10.0) (2022-11-10)

### Bug Fixes

* **java:** Added support gradle kotlin dsl ([#1289](#1289)) ([5b186d6](5b186d6))
* **java:** detect empty java version ([178ffc9](178ffc9))
* **sudo:** Sudo should be hidden by default ([36a5852](36a5852))
* **upsearch:** find complains about -name. Fix [#1286](#1286) ([5e8b7c0](5e8b7c0))
* **upsearch:** Prevent globs from expanding to early ([b10e093](b10e093))

### Features

* **gnu_screen:** Add Screen session section to prompt ([#1062](#1062)) ([f996381](f996381))
* **sudo:** Add sudo section ([49ce387](49ce387))
* **vlang:** Add V Section ([#877](#877)) ([9399e09](9399e09))
@denysdovhan
Copy link
Member

🎉 This PR is included in version 4.10.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@denysdovhan denysdovhan added the released Released issues and PRs label Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature A PR that implement feature (section, specific behavior, etc). released Released issues and PRs
Development

Successfully merging this pull request may close these issues.

None yet

2 participants