View previous topic :: View next topic |
Author |
Message |
ShorTie Tux's lil' helper
Joined: 12 Feb 2006 Posts: 101
|
Posted: Sun Jan 07, 2024 9:56 pm Post subject: git |
|
|
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 |
|
|
sublogic Apprentice
Joined: 21 Mar 2022 Posts: 222 Location: Pennsylvania, USA
|
Posted: Sun Jan 07, 2024 10:27 pm Post subject: |
|
|
It feeds its output into a pager, doesn't it ? |
|
Back to top |
|
|
ShorTie Tux's lil' helper
Joined: 12 Feb 2006 Posts: 101
|
Posted: Sun Jan 07, 2024 10:42 pm Post subject: |
|
|
pager ??
never heard of it |
|
Back to top |
|
|
flexibeast Guru
Joined: 04 Apr 2022 Posts: 324 Location: Naarm/Melbourne, Australia
|
Posted: Sun Jan 07, 2024 11:03 pm Post subject: |
|
|
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 |
|
|
ShorTie Tux's lil' helper
Joined: 12 Feb 2006 Posts: 101
|
Posted: Mon Jan 08, 2024 5:56 am Post subject: |
|
|
Just simple things like
|
|
Back to top |
|
|
Banana Veteran
Joined: 21 May 2004 Posts: 1392 Location: Germany
|
|
Back to top |
|
|
ShorTie Tux's lil' helper
Joined: 12 Feb 2006 Posts: 101
|
Posted: Mon Jan 08, 2024 7:11 am Post subject: |
|
|
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 |
|
|
Banana Veteran
Joined: 21 May 2004 Posts: 1392 Location: Germany
|
Posted: Mon Jan 08, 2024 2:11 pm Post subject: |
|
|
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: | [33;01m * IMPORTANT:[39;49;00m 1 news items need reading for repository 'genpi64'.
[33;01m * IMPORTANT:[39;49;00m 20 news items need reading for repository 'gentoo'.
[33;01m *[39;49;00m Use [32;01meselect news read[39;49;00m 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 |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21639
|
Posted: Mon Jan 08, 2024 3:21 pm Post subject: |
|
|
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 |
|
|
ShorTie Tux's lil' helper
Joined: 12 Feb 2006 Posts: 101
|
Posted: Mon Jan 08, 2024 7:23 pm Post subject: |
|
|
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 |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3139
|
Posted: Mon Jan 08, 2024 10:24 pm Post subject: |
|
|
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 |
|
|
flexibeast Guru
Joined: 04 Apr 2022 Posts: 324 Location: Naarm/Melbourne, Australia
|
Posted: Mon Jan 08, 2024 11:31 pm Post subject: |
|
|
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 |
|
|
Banana Veteran
Joined: 21 May 2004 Posts: 1392 Location: Germany
|
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21639
|
Posted: Tue Jan 09, 2024 3:47 pm Post subject: |
|
|
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 |
|
|
ShorTie Tux's lil' helper
Joined: 12 Feb 2006 Posts: 101
|
Posted: Tue Jan 09, 2024 7:58 pm Post subject: |
|
|
Thankz
Code: | git config --global core.pager "" |
Tis good enough for me
Have a Good Day
Jeff |
|
Back to top |
|
|
|