henrikruscon / hyper-statusline Goto Github PK
View Code? Open in Web Editor NEWStatus Line Plugin for Hyper
License: MIT License
Status Line Plugin for Hyper
License: MIT License
I'm on the latest version of Hyper and I disabled other plugins, so I don't think it's another one interfering. There's nothing in the console.
It looks like the problem is the background-color for the icons is being set to undefined
… I'm not overriding them so for some reason the default/fallback at config.colors.lightYellow
and config.colors.blue
must be undefined
.
Normally when a new tab is opened in Hyper it opens at the user's home directory, as is conventional in most shells / terminals.
With hyper-statusline installed, new tabs open in the same directory as the PWD in the tab which is focused when Cmd+T is pressed.
Regardless of which behaviour you or I prefer, this type of configuration / behaviour change is outside the scope of a statusline plugin. At the very least, it should be optional, but really it is for a different plugin – better still, a config option in Hyper...
From the hyper docs:
We encourage you to maintain compatibility with other decorators. Since many can be set, don't assume that yours is the only one. For example, if you're passing children, compose potential existing values:
render () {
const customChildren = Array.from(this.props.customChildren)
.concat(<p>My new child</p>);
return <Tab {...this.props} customChildren={customChildren} />
}
It looks like the decorateHyper function currently overrides this.props.customChildren rather than appending to it.
It would be great if you can adjust the status line font to match with the current font used on terminal.
I would like to know if this is currently possible.
Regards.
Instead of /Users/bevacqua/dev
, display ~/dev
. You can use tildify
for this
When I use rupa/z for navigation the cwd will not be updated.
I use Mac OS 10.12.2.
After SSH-ing into a remote server and cd
-ing into a directory that is a git repo status line does not detect that I'm in a git repo and does not show the branch I'm working on.
Could we get an option to change the font size of the text? My eyes aren't great these days and being able to make the text bigger would be nice.
It would be nice to make the git remote configurable. Possibly, on a per-directory-basis
https://github.com/henrikdahl/hyper-statusline/blob/master/index.js#L167
e.g: I want to be able to use upstream
instead of origin
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for [email protected]: wanted {"os":"! win32","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! notsup Valid OS: !win32
npm ERR! notsup Valid Arch: any
npm ERR! notsup Actual OS: win32
npm ERR! notsup Actual Arch: x64
I initially thought this was an issue with Hyper, but it turns out disabling hyper-statusline
solves it.
I have a task which takes about 30 seconds to run when using iTerm (or, it turns out, vanilla Hyper).
When using Hyper with hyper-statusline enabled, the same task takes around 80 seconds - in other words, more than twice as long.
The task in question is a private (unpublished - in development) Node.js application which is running Prince in a child process to render a PDF from an HTML file.
I haven't tried doing any further debugging – I don't have much time at the moment so I've simply gone back to iTerm for now. But if you have any ideas I will try to check them out, likewise if you want me to test anything else…
First off, let me say that I've been enjoying hyper-statusline very much. It's a great addition to my Hyper experience! 🎉
One request: Currently, when you're on a git branch, hyper-statusline shows the branch name in the lower-right corner. But if you check out a commit that isn't the head of a branch, the corner is blank. I'd enjoy seeing the SHA of the current commit there.
I've been using this plugin with Hyper (v1.1.0 currently), recently after a switch to zsh on macOS, the functionality seems to go dead. That is, I've set Hyper to use bash as the default shell, and the plugin works fine; when I switch over to zsh, the plugin stops working. Is zsh not supported? I'm having trouble identifying the source of this error.
(See details at henrikruscon/hyper-tabs-enhanced#19.)
Not sure if it was intensional, but when you split the window, you share the status line across all splits, and statusline shows the one you have focusing:
I would love to be able to have one status line per split... not sure if everyone prefers that or having a option to have a global one and one per split.
Great work on the plugin btw, loved it. 🎉
I'd like to replace my PS1 template with this plugin but I need to see the name of the branch which is being rebased.
These are the outputs I see with my current prompt:
# on a regular branch
master
# during a rebase; this is what the plugin doesn't display
(no branch, rebasing master)
This is the function I use for getting the info:
function parse_git_branch {
ref=$(git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1 /')
if [ "$ref" != "" ]; then
echo -e "\033[2;37m@\033[0;37m ${ref#refs/heads/}"
fi
}
Is this something you would be willing to add? I might take a crack at it myself eventually.
I really like this plugin compared to the alternative. It's clean and simple and I feel like it has a lot of room for a plugin architecture so that devs could add something like:
Thoughts?
Just recently began using this plugin with Hyper 1.0.0 and Hyper 1.0.1, and encountered an error (running Ubuntu 14.04). In particular, a sort of statusline appears (basically, just a lightly colored area at the bottom of the Hyper window), but the appropriate icons fail to display entirely. Based on a cursory look, it doesn't seem like any related issues have been reported.
Hey,
thanks for this great hyper plugin. Just wondering if you'd be interested in adding an indicator for the amount of commits the current branch is behind the tracked branch?
The bar appears but the folder or git information doesn't show at all.
Below is my hyper config file:
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
// default font size in pixels for all tabs
fontSize: 16,
// font family with optional fallbacks
fontFamily: '"Fira Code"',
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk)
// cursorColor: 'rgba(248,28,229,0.8)',
// terminal text color under BLOCK cursor
// cursorAccentColor: '#000',
// `'BEAM'` for |, `'UNDERLINE'` for _, `'BLOCK'` for █
cursorShape: 'UNDERLINE',
// set to `true` (without backticks and without quotes) for blinking cursor
cursorBlink: true,
// color of the text
// foregroundColor: '#fff',
// terminal background color
// opacity is only supported on macOS
// backgroundColor: '#000',
// terminal selection color
// selectionColor: 'rgba(248,28,229,0.3)',
// border color (window, tabs)
// borderColor: '#333',
// custom CSS to embed in the main window
css: '',
// custom CSS to embed in the terminal window
termCSS: '',
// set to `true` (without backticks and without quotes) if you're using a
// Linux setup that doesn't show native menus
// default: `false` on Linux, `true` on Windows, ignored on macOS
// showHamburgerMenu: '',
// set to `false` (without backticks and without quotes) if you want to hide the minimize, maximize and close buttons
// additionally, set to `'left'` if you want them on the left, like in Ubuntu
// default: `true` (without backticks and without quotes) on Windows and Linux, ignored on macOS
// showWindowControls: '',
// custom padding (CSS format, i.e.: `top right bottom left`)
// padding: '12px 14px',
// the full list. if you're going to provide the full color palette,
// including the 6 x 6 color cubes and the grayscale map, just provide
// an array here instead of a color map object
// colors: {
// black: '#000000',
// red: '#ff0000',
// green: '#33ff00',
// yellow: '#ffff00',
// blue: '#0066ff',
// magenta: '#cc00ff',
// cyan: '#00ffff',
// white: '#d0d0d0',
// lightBlack: '#808080',
// lightRed: '#ff0000',
// lightGreen: '#33ff00',
// lightYellow: '#ffff00',
// lightBlue: '#0066ff',
// lightMagenta: '#cc00ff',
// lightCyan: '#00ffff',
// lightWhite: '#ffffff',
// },
// the shell to run when spawning a new session (i.e. /usr/local/bin/fish)
// if left empty, your system's login shell will be used by default
//
// Windows
// - Make sure to use a full path if the binary name doesn't work
// - Remove `--login` in shellArgs
//
// Bash on Windows
// - Example: `C:\\Windows\\System32\\bash.exe`
//
// PowerShell on Windows
// - Example: `C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`
shell: '/bin/zsh',
// for setting shell arguments (i.e. for using interactive shellArgs: `['-i']`)
// by default `['--login']` will be used
shellArgs: ['--login'],
// for environment variables
env: {},
// set to `false` for no bell
bell: 'SOUND',
// if `true` (without backticks and without quotes), selected text will automatically be copied to the clipboard
copyOnSelect: true,
// if `true` (without backticks and without quotes), on right click selected text will be copied or pasted if no
// selection is present (`true` by default on Windows and disables the context menu feature)
// quickEdit: true,
// URL to custom bell
// bellSoundURL: 'http://example.com/bell.mp3',
// for advanced config flags please refer to https://hyper.is/#cfg
},
// a list of plugins to fetch and install from npm
// format: [@org/]project[#version]
// examples:
// `hyperpower`
// `@company/project`
// `project#1.0.1`
plugins: [
'hyperterm-paste',
'hyperlinks',
'hyperterm-alternatescroll',
'hyper-alt-click',
'hyperterm-safepaste',
'hyper-search',
'hyperminimal',
'hyperterm-panda',
'hyper-statusline',
],
// in development, you can create a directory under
// `~/.hyper_plugins/local/` and include it here
// to load it and avoid it being `npm install`ed
localPlugins: [],
keymaps: {
// Example
// 'window:devtools': 'cmd+alt+o',
},
};
I am running Manjaro Linux 4.14.14 and hyper 2.0.0-canary.9
Add an option to let the user choose from what they want to do if they click on the directory or branch name.
Why? Some users may accidentally click on the directory or branch name and the plugin automatically open the directory or the browser.
Examples:
...
hyperStatusLine: {
onDirectoryClick: 'none',
onBranchClick: 'copyBranchName'
}
...
/*
onDirectoryClick:
'none'
'copyDirectoryName'
'openDirectory' // default
onBranchClick
'none'
'copyBranchName'
'copyBranchURL'
'openBranchURL' // default
*/
none
should be enough if copy to clipboard is not possible.
I like status line because I can keep my prompt small, but sometimes I forget what directory I'm in. It's simple enough to glance down and read the path, but it might be cool to color code the bar based on cwd (or any arbitrary condition via a configuration callback?). Maybe even color the git branch portion separately so you can glance and see if you're on the master branch.
Down to work on this and contribute upstream, but wanted to shop the idea around before digging in. Totes down to do this as a fork as well.
I'm getting something like the following:
when in a very large repo (8+gigs), hyper-statusline will interfere with git commands and cause a lock
fatal: Unable to create '<path to repo>/.git/index.lock': File exists. If no other git process is currently running, this probably means a git process crashed in this repository earlier. Make sure no other git process is running and remove the file manually to continue.
When I cd into a directory the status line path does not update before I execute the next command.
Like this:
(status line shows '~')
~ > cd dev
(status line still shows '~')
~/dev > *enter* (or any command)
(status line updates to '~/dev')
~/dev >
A potential feature idea… It occurred to me that clicking the name of the current branch could open a menu with a list of other existing branches, which could be switched to by clicking on them.
What do you think? May be quite a big job to implement (I haven't really thought yet about how it would be implemented…)
Looks like it only updates on session based events. I'd expect the cwd to update on changing directories as well.
It would be nice if clicking the branch name took you to the branch if the remote is git via SSH rather than HTTPS.
With my theme (solarized dark) I find the footer isn't as visible as I'd like with the default transparency.
I override it by adding this to my Hyper options object:
css: '.footer_footer { opacity: 1 !important; }',
Do you think a simple option to disable it would be useful to others, or am I alone in preferring that it be opaque?
Hi,
I just installed hyper-statusline
and when I launch Hyper, my prompt won't appear and it's impossible for me to input anything into the terminal.
In the console i have the following error (which doesn't appear when I remove the plugin)
Uncaught TypeError: Cannot read property 'substr' of null -- bundle.js:47
Any idea why ?
Thanks :)
Is it expected behaviour?
The git repository detection is flawed.
My git repo does not have .git files in subfolder only in the main folder.
A better way to detect would be:
git rev-parse --is-inside-work-tree
When initially launched on 2.0.2, this plugin seems to have no effect at all:
… but if I change the hyperStatusLine
configuration, and hit save in my editor, the status-line suddenly appears (without, however, respecting the configuration I just set?)
Here's hoping you guys get a chance to give this some update-love! This is an essential part of Hyper for me, and I don't want it to break when 2.0 goes stable! <3
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.