Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
git
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
ShorTie
Tux's lil' helper
Tux's lil' helper


Joined: 12 Feb 2006
Posts: 101

PostPosted: Sun Jan 07, 2024 9:56 pm    Post subject: git Reply with quote

Don't know what I did.
Now when ever I do a git xxxx, it clears the screen before and after.
Bugs me .. ;/~

Is that some kind of bash completion ??
Back to top
View user's profile Send private message
sublogic
Apprentice
Apprentice


Joined: 21 Mar 2022
Posts: 222
Location: Pennsylvania, USA

PostPosted: Sun Jan 07, 2024 10:27 pm    Post subject: Reply with quote

It feeds its output into a pager, doesn't it ?
Back to top
View user's profile Send private message
ShorTie
Tux's lil' helper
Tux's lil' helper


Joined: 12 Feb 2006
Posts: 101

PostPosted: Sun Jan 07, 2024 10:42 pm    Post subject: Reply with quote

pager ??
never heard of it
Back to top
View user's profile Send private message
flexibeast
Guru
Guru


Joined: 04 Apr 2022
Posts: 324
Location: Naarm/Melbourne, Australia

PostPosted: Sun Jan 07, 2024 11:03 pm    Post subject: Reply with quote

A 'pager' is a program that is used to display file contents that don't fit within a single screen, so that one can scroll through them at one's leisure. A common pager is less(1), which is typically the default pager on many systems, as is the case on Gentoo. less has an `-X` / `--no-init` option:
Quote:
-X or --no-init
Disables sending the termcap initialization and deinitialization strings to the terminal. This is sometimes desirable if the deinitialization string does something unnecessary, like clearing the screen.

You haven't yet shared enough details to help narrow down the issue. Can you please share the full, exact command(s) that you're running?
Back to top
View user's profile Send private message
ShorTie
Tux's lil' helper
Tux's lil' helper


Joined: 12 Feb 2006
Posts: 101

PostPosted: Mon Jan 08, 2024 5:56 am    Post subject: Reply with quote

Just simple things like
Code:
git diff

Code:
git branch
Back to top
View user's profile Send private message
Banana
Veteran
Veteran


Joined: 21 May 2004
Posts: 1392
Location: Germany

PostPosted: Mon Jan 08, 2024 6:28 am    Post subject: Reply with quote

Please post your output of (use wgetpast or any other pasteservice if the output is long)
- emerge --info
- emerge dev-vcs/git -pv
- your .bashrc
_________________
My personal space
My delta-labs.org snippets do expire

PFL - Portage file list - find which package a file or command belongs to.
Back to top
View user's profile Send private message
ShorTie
Tux's lil' helper
Tux's lil' helper


Joined: 12 Feb 2006
Posts: 101

PostPosted: Mon Jan 08, 2024 7:11 am    Post subject: Reply with quote

https://bpa.st/MZPA

And

Code:
# /etc/bash/bashrc
#
# This file is sourced by all *interactive* bash shells on startup,
# including some apparently interactive shells such as scp and rcp
# that can't tolerate any output.  So make sure this doesn't display
# anything or bad things will happen !


# Test for an interactive shell.  There is no need to set anything
# past this point for scp and rcp, and it's important to refrain from
# outputting anything in those cases.
if [[ $- != *i* ]] ; then
   # Shell is non-interactive.  Be done now!
   return
fi

# Bash won't get SIGWINCH if another process is in the foreground.
# Enable checkwinsize so that bash will check the terminal size when
# it regains control.  #65623
# http://cnswww.cns.cwru.edu/~chet/bash/FAQ (E11)
shopt -s checkwinsize

# Enable history appending instead of overwriting.  #139609
shopt -s histappend

# Change the window title of X terminals
case ${TERM} in
   xterm*|rxvt*|Eterm*|aterm|kterm|gnome*|interix)
      PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\007"'
      ;;
   screen*)
      PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\033\\"'
      ;;
esac

use_color=false

# Set colorful PS1 only on colorful terminals.
# dircolors --print-database uses its own built-in database
# instead of using /etc/DIR_COLORS.  Try to use the external file
# first to take advantage of user additions.  Use internal bash
# globbing instead of external grep binary.
safe_term=${TERM//[^[:alnum:]]/?}   # sanitize TERM
match_lhs=""
[[ -f ~/.dir_colors   ]] && match_lhs="${match_lhs}$(<~/.dir_colors)"
[[ -f /etc/DIR_COLORS ]] && match_lhs="${match_lhs}$(</etc/DIR_COLORS)"
[[ -z ${match_lhs}    ]] \
   && type -P dircolors >/dev/null \
   && match_lhs=$(dircolors --print-database)
[[ $'\n'${match_lhs} == *$'\n'"TERM "${safe_term}* ]] && use_color=true

if ${use_color} ; then
   # Enable colors for ls, etc.  Prefer ~/.dir_colors #64489
   if type -P dircolors >/dev/null ; then
      if [[ -f ~/.dir_colors ]] ; then
         eval $(dircolors -b ~/.dir_colors)
      elif [[ -f /etc/DIR_COLORS ]] ; then
         eval $(dircolors -b /etc/DIR_COLORS)
      fi
   fi

   if [[ ${EUID} == 0 ]] ; then
      PS1='\[\033[01;31m\]\h\[\033[01;32m\] \W \$\[\033[00m\] '
   else
      PS1='\[\033[01;32m\]\u@\h\[\033[01;32m\] \w \$\[\033[00m\] '
   fi

   alias ls='ls --color=auto'
   alias grep='grep --colour=auto'
   alias egrep='egrep --colour=auto'
   alias fgrep='fgrep --colour=auto'
else
   if [[ ${EUID} == 0 ]] ; then
      # show root@ when we don't have colors
      PS1='\u@\h \W \$ '
   else
      PS1='\u@\h \w \$ '
   fi
fi

# Try to keep environment pollution down, EPA loves us.
unset use_color safe_term match_lhs



source /usr/share/git/git-prompt.sh
export PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w\[\033[01;33m\]$(__git_ps1)\[\033[01;34m\] \$\[\033[00m\] '
export GIT_PS1_SHOWDIRTYSTATE=1


Back to top
View user's profile Send private message
Banana
Veteran
Veteran


Joined: 21 May 2004
Posts: 1392
Location: Germany

PostPosted: Mon Jan 08, 2024 2:11 pm    Post subject: Reply with quote

Code:
source /usr/share/git/git-prompt.sh
export PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w\[\033[01;33m\]$(__git_ps1)\[\033[01;34m\] \$\[\033[00m\] '
export GIT_PS1_SHOWDIRTYSTATE=1

Do you know what this does? Maybe this is the problem


Code:
 * IMPORTANT: 1 news items need reading for repository 'genpi64'.
 * IMPORTANT: 20 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.

Also, please read the news items: https://www.gentoo.org/support/news-items/ and make sure the instructions are followed
_________________
My personal space
My delta-labs.org snippets do expire

PFL - Portage file list - find which package a file or command belongs to.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21639

PostPosted: Mon Jan 08, 2024 3:21 pm    Post subject: Reply with quote

If you run /usr/bin/env -i "HOME=$HOME" "TERM=$TERM" /usr/bin/git diff, do you still get the bad behavior? What if you instruct git to ignore its configuration files?

Also, Banana asked for your personal bashrc. You posted what appears to be the system-wide bashrc.
Back to top
View user's profile Send private message
ShorTie
Tux's lil' helper
Tux's lil' helper


Joined: 12 Feb 2006
Posts: 101

PostPosted: Mon Jan 08, 2024 7:23 pm    Post subject: Reply with quote

When I run
Code:
/usr/bin/env -i "HOME=$HOME" "TERM=$TERM" /usr/bin/git diff

Everything seems fine.

Thats the bashrc I change /root/.bashrc too,.
Yes, I'm a bad boy and play as root .. :/~
Been using it for the last 20 years.
I know that don't make it right, lol.

I tied rem'n those 2 git lines out and started a new scp window and it made no difference.
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3139

PostPosted: Mon Jan 08, 2024 10:24 pm    Post subject: Reply with quote

Code:
PAGER="" git <command>

Apparently one can also permanently disable use of pager in git with command below; haven't tried though.
Code:
git config --global core.pager ""
Back to top
View user's profile Send private message
flexibeast
Guru
Guru


Joined: 04 Apr 2022
Posts: 324
Location: Naarm/Melbourne, Australia

PostPosted: Mon Jan 08, 2024 11:31 pm    Post subject: Reply with quote

ShorTie wrote:
I tied rem'n those 2 git lines out and started a new scp window and it made no difference.

Which two lines exactly? There are three lines at the end of the file that contain the text "git" in some form, as referenced by Banana earlier. Did you comment out the line that `source`s git-prompt.sh? What are the contents of git-prompt.sh?
Back to top
View user's profile Send private message
Banana
Veteran
Veteran


Joined: 21 May 2004
Posts: 1392
Location: Germany

PostPosted: Tue Jan 09, 2024 7:21 am    Post subject: Reply with quote

The line "source /usr/share/git/git-prompt.sh" could be this https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh
_________________
My personal space
My delta-labs.org snippets do expire

PFL - Portage file list - find which package a file or command belongs to.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21639

PostPosted: Tue Jan 09, 2024 3:47 pm    Post subject: Reply with quote

szatox provided a way to inhibit the git pager. Is that sufficient for your use or do you want to change the behavior of your existing pager to make it cease clearing the screen?
Back to top
View user's profile Send private message
ShorTie
Tux's lil' helper
Tux's lil' helper


Joined: 12 Feb 2006
Posts: 101

PostPosted: Tue Jan 09, 2024 7:58 pm    Post subject: Reply with quote

Thankz
Code:
git config --global core.pager ""

Tis good enough for me

Have a Good Day
Jeff
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum