Giter Site home page Giter Site logo

Comments (2)

mafredri avatar mafredri commented on June 26, 2024

When opening a new terminal, pure first prints a prompt with first line empty and then after couple hundred milliseconds clears the terminal and writes prompt without a empty first line.

The Pure prompt should not re-render itself unless you are in a git repo (and the actual prompt line changed). Also, the initial newline being erased sounds weird, it's almost as if your prompt setup/terminal is triggering a clear screen event.

A few thoughts:

  • Why does it seem like you're using dash instead of zsh in some of those examples?
  • What version of Zsh are you using? (you didn't specify, report says dash)
  • Do you have any other Zsh configuration files, like .zshenv, .zprofile, .zlogin, etc?
    • What about similar files in /etc?

I'd like a option for it to write the prompt without the empty first line the first time it's printed.

See #233 (comment) as to why we can't support this.

from pure.

Jaakkonen avatar Jaakkonen commented on June 26, 2024

Environment details
It looks like the prompt_pure_system_report reports dash as my zsh as it's my /bin/sh. Here I'm invoking zsh for a interactive shell directly when launching a terminal.

Zsh version is 5.8 (x86_64-pc-linux-gnu). Arch linux package.

No other Zsh config files in these tests (ZDOTDIR was placed to a test directory with the .zshrc and global /etc/zsh/* and /etc/{zprofile,zshrc,zlogin} do not exist)

I also tried the python PTY debug process in a docker container (archlinux, zsh 5.8, latest pure main branch tag v1.18.0) with pure cloned to /usr/share/zsh/pure and zshrc file as follows

# /etc/zsh/zshrc
fpath+=/usr/share/zsh/pure
autoload -U promptinit
promptinit
prompt pure

with this setup I only got one prompt

>>> from ptyprocess import PtyProcessUnicode
>>> p = PtyProcessUnicode.spawn(['zsh', '-i'])
>>> p.read()
'\x1b]0;(7cac67499309) /\x07\r\n\x1b[0m\x1b[27m\x1b[24m\x1b[J\x1b[39mroot\x1b[39m\x1b[39m@7cac67499309\x1b[39m \x1b[34m/\x1b[39m\r\n\r\x1b[35m❯\x1b[39m \x1b[K\x1b[?2004h'

so the issue seems to be somewhere in my local setup.

Anyway, I cannot reproduce the prompt getting written twice in the docker setup. I'll create a new ticket/reopen/comment if I find a way to reproduce the issue in a simple container.

See #233 (comment) as to why we can't support this.

That makes sense. I cannot come up with a trivial way to distinguish the case where a new empty terminal is launched from the other cases such as ssh and launching zsh from other shell.

This answers my question pretty well, for some reason I couldn't find the existing issues that well with GH issue search. Thanks! :)

from pure.

Related Issues (20)

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.