Giter Club home page Giter Club logo

promptastic's People

Contributors

linucc avatar puntonim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

promptastic's Issues

Errors when .git folder is accessed

If you open the .git folder:

$ cd .git/hooks/
fatal: This operation must be run in a work tree

Errors are outputted in every executed command.

Improve performance

Performance could be improved if the configuration were hard-coded in promptastic.py. Currently promptastic reads the configuration in config.py to display the enabled segments with the chosen theme's colors. This could be done better this way:

  • promptastic.py becomes a template, say promptastic.py.template
  • install.py creates the actual promptastic.py script out of that template by reading config.py and injecting only the enabled segments with hard-coded colors.

Screenshots

Add some screenshots to be used in the docs

screenshot1

currdir

exitcode

git

jobs

ssh

time

userathost

venv

theme-light

no-patched-fonts

UnicodeDecodeError: 'ascii' codec can't decode byte 0xcc in position 68

I have a problem, which I wasn't able to fix myself. If my directory i want to cd in contains german umlauts, then I got the error mentioned in the title:

$ cd /Users/Martin/Dropbox/Entwicklung/Bstäpp
Traceback (most recent call last):
  File "/Users/Martin/bin/promptastic/promptastic.py", line 186, in <module>
    write(prompt.render())
  File "/Users/Martin/bin/promptastic/promptastic.py", line 37, in render
    first_line = self._render_first_line()
  File "/Users/Martin/bin/promptastic/promptastic.py", line 65, in _render_first_line
    output += segment.render()
UnicodeDecodeError: 'ascii' codec can't decode byte 0xcc in position 68: ordinal not in range(128)

Any idea where to encode de ascii-string in the promptastic.py? Thanks for your help!

Remember current directory

Is Promptastic remembering the current directory when a new tab or window is opened? Or is it always putting the user on home?

FileNotFoundError is not defined

I am suddenly getthing this error whenever I am not in a directory of a git repo:

Traceback (most recent call last):
  File "/home/rogermortis/dotfiles/bash/promptastic/segments/git.py", line 42, in get_branch_name
    raise FileNotFoundError
NameError: global name 'FileNotFoundError' is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/rogermortis/promptastic/promptastic.py", line 164, in <module>
    prompt.first_line_right.append(git.Git())
  File "/home/rogermortis/dotfiles/bash/promptastic/segments/__init__.py", line 22, in __init__
    self.init(*args, **kwargs)
  File "/home/rogermortis/dotfiles/bash/promptastic/segments/git.py", line 11, in init
    branch_name = self.get_branch_name()
  File "/home/rogermortis/dotfiles/bash/promptastic/segments/git.py", line 43, in get_branch_name
    except FileNotFoundError:
NameError: global name 'FileNotFoundError' is not defined

I don't think I changed anything...

No colors and prompt align

I'm using Manjaro Linux (Arch Linux). Removed the power-line from ~/.bashrc and ran ./install.py with no config.py modification. ~/.bashrc and ~/.profile looks good as you can see in 2nd screenshot.

The prompt have no colors.

I'm using Konsole 2.14 and KDE 4.14.0.

My Python and Bash version, and my config.py.
promptastic_problem

Last lines of my ~/.bashrc and ~/.profile
promptastic_problem_2

Executing install.py does nothing

Hello there!

I was using your wonderful project on my previous Ubuntu, with Unity (yeah, everyone does some mistakes...). The installation was good.

I have re-installed my computer from scratch yesterday with a Kubuntu 15.04. So, I'm using Konsole now as terminal emulator. I wanted to re-install your project too, but when I am starting the install.sh file, it does nothing: no output.

I put the line export TERM=xterm-256color in my bashrc file as you mentioned in your INSTALL.md.

clotaire@Boromir:~$ echo $TERM
xterm-256color

Here is what it does when I start install.py file:

clotaire@Boromir:~$ cd Projets/promptastic/
clotaire@Boromir:~/Projets/promptastic$ ./install.py 
clotaire@Boromir:~/Projets/promptastic$ 

And then, Konsole is buggy, for example if I want to edit a file using vim in it after trying to install your project, it does this:

clotaire@Boromir:~/Projets/promptastic$ vim install.py 
Vim : Alerte : La sortie ne s'effectue pas sur un terminal (translation: Warning: output is not to a terminal)

Any help is appreciate! Thanks for your time.

Width mistake prompt (to wide)

With the default configuration on terminator, my prompt looks like the screenshot below.

Screenshot_20191105_204742

Screenshot is of terminator, Konsole looks the same.

The configuration in my .bashrc file is the following:

#  Promptastic is assumed to be installed in $promptastic_home
promptastic_home=~/.local/opt/promptastic


function _update_ps1() {
  PS1="$(${promptastic_home}/promptastic.py $?)"
  export PS1
}

if [ -f "${promptastic_home}/promptastic.py" ]; then
  export PROMPT_COMMAND="_update_ps1"
fi

My 'config.py` file is the following:

# This is the configuration file which helps you customize your 'promptastic' installation.
# For instructions on how to use the promptastic.py script, see the README.

# Patched fonts are special fonts best suited for terminals
# True if the current terminal is using patched fonts (available at:
# https://github.com/Lokaltog/powerline-fonts).
PATCHED_FONTS = True

# The theme defines the colors used to draw individual segments.
# Themes are collected in the `themes` directory. Their names match their file name (w/o the file
# extension .py).
THEME = 'default'

# Segments are the single elements which compose the Bash shell prompt.
# Enable or disable these segments to customize what you see on the shell prompt.
SEGMENTS = {
    # Current user's username plus @ plus machine's hostname.
    'userathost': True,

    # SSH tag when ssh-ing from another machine.
    'ssh': True,

    # Current directory path.
    'currentdir': True,

    # A padlock if the current user has read-only permissions on the current directory.
    'readonly': True,

    # A cross if the last command exited with a non-zero exit code.
    'exitcode': True,

    # Current git branch and status when the current directory is part of a git repo.
    'git': True,

    # Name of the current virtual environment (see http://www.virtualenv.org/), if any.
    'venv': True,

    # Number of running jobs, if any.
    'jobs': True,

    # Current time.
    'time': True,
}

The promptastic.py file did I not change.

Googling the mistake and reading the documentation hasn't helped me.

Another suggestion for INSTALL.md, add a path to where the config.py file will be stored. It is not mentioned here.

Git showing "unknown" background

I'm seeing this in all of my git repos:

screen shot 2016-09-21 at 5 07 41 pm

Not quite sure how to further debug this. It seems to have started happening after updating my version of xcode.

Python 2 compatibility

Make Promptastic compatible with both Python 2 and 3.

Things to keep in mind:

  • FileNotFoundError does not exist in Python 2, see issue 17

Option -o in Segments/Jobs causes errors in Cygwin

I know this is probably not in your expected use cases, but I'm using Promptastic in Cygwin, which uses a stripped-down version of the ps command that doesn't have a -o option. As a result, the ps command in sysinfo.py: line 19 generates errors that appear every time a new prompt is displayed. It's only an annoyance, so I'd understand if this is low priority, but the fix seems like it would be simple. Just redirect stderr to /dev/null temporarily, perhaps?

In any case, I hope you might alter the relevant code to handle this case. If you need any further information on this issue, I'll be happy to respond.

Ability to specify order of segments and prompt on one line

Hi, awesome project! I just couldn't get Powerline's git plugin configured on my Ubuntu box and this works a charm!

  • One thing I think would be really useful is the ability to configure the order in which the prompt segments are displayed (maybe have config dictionary become an OrderedDict?).
  • Also, I would really like to be able to type my commands on the same line as the prompt, i.e. not have the rest of the term window taken up by an empty blank line as does currently happen on my setup.

My Setup:

promptastic

Aim 😄:

zsh-git

Let me know your thoughts, I might be able to hack on this project a bit 😉 🔨

Ubuntu: graphical login broken

After installing promptastic in Ubuntu, the graphical login is broken. The login screen keeps showing up even after a successful login.

The reason is that promptastic must be installed only in ~/.bashrc and not in ~/.profile.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.