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

Plugin for displaying ZSH prompt responsively #3263

Closed

Conversation

nikhgupta
Copy link
Contributor

Hey, I created a responsive prompt for myself, and wanted to contribute the underlying script as a plugin to OhMyZSH. I have documented the instructions, etc.

screenshots

@mcornella
Copy link
Member

This looks impressive and it's a great proof of concept! Let me have some fun with this and see what we can build with it.

I particularly like the breakpoint functionality, that so closely resembles media queries. It looks like it's really flexible! 👍

A quick google search showed me that other people had a go at this (in bash), let's see if we can achieve having responsive prompts by default.

BTW, if you want to try something else, you could try to remove the need to press ENTER to refresh the prompt, using TRAPALRM and TMOUT. It is a little buggy though.

Cheers!

@nikhgupta
Copy link
Contributor Author

Thanks!

For a sample implementation (the one in above screenshots), you can have a look at my prompt. (Note that, I am heavily iterating over my dotfiles, currently)

Regarding the breakpoints, media-queries were my exact inspiration source :)

This PR is slightly buggy/feature-deficient at the moment (e.g. prompt does not shrink when size remains same but prompt length changes because of a directory change, etc.). I am working on that.

I will have a look at how other people are doing this, and extract the good parts. Also, will have a look at the ZSH manual, tonight.

(cherry picked from commit 25a04de1e51358fc8b119c047343a060ee34ced6)
(cherry picked from commit 3f47be12e38c82d09ddaa4ba59269fa642d18840)
@kapsh
Copy link
Contributor

kapsh commented Jun 28, 2017

It looks cool. But why this was abandoned since 2014?

@nikhgupta
Copy link
Contributor Author

@mcornella Is this still a go? Wanted to close all open PRs I have.

@mcornella mcornella added Area: plugin Issue or PR related to a plugin New: plugin Request for a plugin or Pull Request that adds one labels Mar 24, 2019
@mcornella mcornella added the Type: documentation Documentation issue or Pull Request label Mar 4, 2020
@mcornella
Copy link
Member

Hey Nikhil, I think the feature is very interesting and I'd like to try to bundle it into OMZ in the near future, but not as a plugin. I'll close this but when/if we use your code you'll get proper attribution.

Sorry for the late response though, we're going through the backlog!

@mcornella mcornella closed this Aug 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: plugin Issue or PR related to a plugin New: plugin Request for a plugin or Pull Request that adds one Type: documentation Documentation issue or Pull Request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants