Giter VIP home page Giter VIP logo

Comments (9)

edklem avatar edklem commented on May 28, 2024 1

agkozak, I have seen something like this before with gnome/gdm. I didn't think it was polyglot issue so I solved it using this in my .bashrc:

if tty -s
then 
    . /path/to/polyglot.sh
fi

That seemed to be all that was needed.
I believe the issue is that the DE loads profiles like .bashrc on login - so the if tty -s just checks if you are loading .bashrc from a terminal/console (which the DE would not be) and then loads polyglot.sh. Something similar could be added at the beginning of the code to check if it's a console and exit if not...

from polyglot.

agkozak avatar agkozak commented on May 28, 2024 1

@edklem, thanks for providing @schwabfk with a quick fix.

@schwabfk, what's in your .bash_profile, .profile, and .bash_login files? Is there any possibility that one of them is sourcing .bashrc?

from polyglot.

agkozak avatar agkozak commented on May 28, 2024 1

@edklem and @schwabfk - I want to thank both of you for reporting this bug. It was a case of typing exit when I meant return! Sorry for any inconvenience.

from polyglot.

agkozak avatar agkozak commented on May 28, 2024

I haven't seen that problem before! Please start out by posting your .bashrc. Thanks.

from polyglot.

schwabfk avatar schwabfk commented on May 28, 2024

agkozak, I have seen something like this before with gnome/gdm. I didn't think it was polyglot issue so I solved it using this in my .bashrc:

if tty -s
then 
    . /path/to/polyglot.sh
fi

That seemed to be all that was needed. I believe the issue is that the DE loads profiles like .bashrc on login - so the if tty -s just checks if you are loading .bashrc from a terminal/console (which the DE would not be) and then loads polyglot.sh. Something similar could be added at the beginning of the code to check if it's a console and exit if not...

That's it!
I just added the lines as you suggested them, and now there is no problem anymore, thanks a lot.

@agkozak Perhaps you can add it as a "troubleshoot" to the readme.md?

from polyglot.

schwabfk avatar schwabfk commented on May 28, 2024

@edklem, thanks for providing @schwabfk with a quick fix.

@schwabfk, what's in your .bash_profile, .profile, and .bash_login files? Is there any possibility that one of them is sourcing .bashrc?

Sure, but as it is a complete new installation, they are pretty empty, but here you go:
[only .profile and .bashrc, as .bash_profile and .bash_login do not exist in opensuse (as far as I know)]

.profile:

# Sample .profile for SUSE Linux
# rewritten by Christian Steinruecken <[email protected]>
#
# This file is read each time a login shell is started.
# All other interactive shells will only read .bashrc; this is particularly
# important for language settings, see below.

test -z "$PROFILEREAD" && . /etc/profile || true

# Some applications read the EDITOR variable to determine your favourite text
# editor. So uncomment the line below and enter the editor of your choice :-)
#export EDITOR=/usr/bin/vim
#export EDITOR=/usr/bin/mcedit

# For some news readers it makes sense to specify the NEWSSERVER variable here
#export NEWSSERVER=your.news.server

# Some people don't like fortune. If you uncomment the following lines,
# you will have a fortune each time you log in ;-)

#if [ -x /usr/bin/fortune ] ; then
#    echo
#    /usr/bin/fortune
#    echo
#fi

.bashrc

    # Sample .bashrc for SUSE Linux
    # Copyright (c) SUSE Software Solutions Germany GmbH
    
    # There are 3 different types of shells in bash: the login shell, normal shell
    # and interactive shell. Login shells read ~/.profile and interactive shells
    # read ~/.bashrc; in our setup, /etc/profile sources ~/.bashrc - thus all
    # settings made here will also take effect in a login shell.
    #
    # NOTE: It is recommended to make language settings in ~/.profile rather than
    # here, since multilingual X sessions would not work properly if LANG is over-
    # ridden in every subshell.
    
    test -s ~/.alias && . ~/.alias || true
    
    # polyglot bash colours
    if tty -s
    then 
      . /home/schwabfk/bash-polyglot/polyglot
    fi

from polyglot.

agkozak avatar agkozak commented on May 28, 2024

. home/schwabfk/bash-polyglot/polyglot

Should it be . home/schwabfk/bash-polyglot/polyglot.sh, or perhaps you renamed the script?

from polyglot.

schwabfk avatar schwabfk commented on May 28, 2024

. home/schwabfk/bash-polyglot/polyglot

Should it be . home/schwabfk/bash-polyglot/polyglot.sh, or perhaps you renamed the script?

It's just renamed ;)

from polyglot.

agkozak avatar agkozak commented on May 28, 2024

It's just renamed ;)

Got it, thanks. OK, I'll have time to think about this a little later, and perhaps you can help me to troubleshoot more.

from polyglot.

Related Issues (12)

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.