Git terminal blank screen on `git branch` returns to normal on `q`

Hi,

New install Manjaro on framework13.

Open terminal, mkdir, write a few small text files. git init, usual error about ‘master’, so reset master to ‘main’.

git add .
git commit and use vim to enter message.

want to see the branches:
git branch goes to blank screen with one column of tildes on the left ‘~’,
Several keys can escape, but not the terminal escape ctrl-c or ctrl-x.

git branch --list does the same.

Not sure where to go with this. Trying to make a repo push to github work, but I can’t see my branch data, so there is something I can’t do to make the push work.

Terminal is really nice though. Wish I had that on the Mac!

You can set the default name to main.

git config --global init.defaultBranch main

This seems fairly normal, except for the missing branches. Silly question, are you sure you haven’t overlooked it?

Did the commit succeed? If not then it won’t show a branch.

# to check
git status 
git log

Otherwise I have no idea what’s gone wrong.

What do you mean by “so there is something I can’t do to make the push work”?

Perhaps you’ve missed something out. So far we seem to have a fairly fresh repo, with 0 or 1 commits/branches and no remote. :man_shrugging:

Doesn’t MacOS have a terminal? Are you talking about the drop down terminal yakuake?

If so, then apparently that’s doable.

Thanks for such a quick and thorough reply.

I knew about init.defaultBranch, and had set that.

On my mac (also zsh) git branch will list even one branch. It takes 5 or 10 lines to do this, and I can see all the previous commands on the screen. What is happening to my frmwk is the whole screen goes blank, I cannot scroll, see any previous commands. Usual escape sequences do not work, but a few keys like q do. No I am not stuck in Vim. when I hit q, the screen goes back to normal on a new line.

The push has an issue cos I haven’t sort the personal access token or private key. this is separate problem to listing the branches. I want to list the branches because I want to see what branch I am on so I can push it, so I know which error I am dealing with, the PAT issue or wrong branch. I appreciate I could just issue the change branch command, and yes this works. Just I would like to see a list of branches when I issue that command.

‘Nice terminal’? I mean the default zsh terminal in KDE Manjaro. It has these really nice flags: what git repo, what venv, colours tags in the prompt, shadow auto complete. Really neat features. Yes I know mac has a default terminal and several others. Learning a new terminal on Mac is not top of my list right now, but thanks for the suggestion, reminds me of when I saw the drop down terminal the first time, in Quake in 1998.

1 Like

Ok, I wasn’t sure from your post, so I included it in case.

It does list a single branch. Not sure what frmwk is, but that all sounds pretty normal to me. Git uses a pager, AFAIK less, to display them. It should say (END) at the bottom, like so:

* main
(END)

and if I press the Up arrow key:

* main
~
~
# missed a few lines out for brevity
~
~
(END)

The only way I’ve found to have an empty list of branches is to not have any commits. :man_shrugging:

I didn’t think you were, you’re in a pager such as less.

If you want to turn paged mode off.

git --no-pager branch
# or
git config --global pager.branch false
# or
# this uses the pager for longer output
# -F might be enough, depending on what you want
git config --global core.pager "less -FRX"

https://stackoverflow.com/questions/48341920/git-branch-command-behaves-like-less

Ah, sounds like the zsh config. I’ve never used a mac but you should be able to port at least some of it.

Checkout ~/.zshrc, though most of it is in other files (which are listed there).

Aah I understand now.

I had an uncommitted change, so it did not list main, just nothing, then press up arrow and single col of ~. Set pager to false, looks like mac output now. New(ish) to git.

Made a commit, pager off, now looks like mac git output, put pager back on and main appears. Test theory, but now cannot replicate the problem. Output is now as you suggest. Got screen shots.

Don’t think I had no commits? pretty sure I made a bunch of files and committed each one in turn. Sorted Thankyou

1 Like

Strange, but at least it’s fixed.

You’re welcome. :slight_smile: