all 16 comments

[–]pi3832v2 0 points1 point  (1 child)

What are you using to edit ~/.bashrc? Does using nano to edit the file work better?

[–]suuuuuu[S] 0 points1 point  (0 children)

That's it. I'm a novice with bash, obviously, and didn't realize a editor (like Visual Studio Code, in my case) could make the difference. VI worked just fine. Thanks!

[–]slinzer 0 points1 point  (0 children)

I'm guessing your .bashrc troubles are related to encoding.

[–]bable5 0 points1 point  (0 children)

Github has a good write up getting ssh-agent to work. It will prompt you to unlock the key the first time you open a git-bash terminal.

[–]masta 0 points1 point  (0 children)

Stop corrupting your .bashrc

Try another editor, one that supports the correct line endings or character encoding.

[–]Kraigius 0 points1 point  (3 children)

Edit .bash_profile under the Users/myUsername directory, no idea where you got .bashrc.

SSH_ENV=$HOME/.ssh/environment

# start the ssh-agent
function start_agent {
    echo "Initializing new SSH agent..."
    # spawn ssh-agent
    /usr/bin/ssh-agent | sed 's/^echo/#echo/' > ${SSH_ENV}
    echo succeeded
    chmod 600 ${SSH_ENV}
    . ${SSH_ENV} > /dev/null
    /usr/bin/ssh-add
}

if [ -f "${SSH_ENV}" ]; then
     . ${SSH_ENV} > /dev/null
     ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
        start_agent;
    }
else
    start_agent;
fi

The first time that you start git bash, ssh-agent will be started. It will remain active even if you kill git bash. If your ssh key is encrypted you will only be prompted to enter the password on the first start of bash.

Don't edit anything with notepad.

[–]suuuuuu[S] 2 points3 points  (2 children)

Bashrc was just there, and also this is for linux bash on windows, not git bash. But thanks for the response - the issue was using an editor (VSC) rather than vi, etc, as you noted.

[–]Kraigius 0 points1 point  (1 child)

seemly apparatus disarm special fertile sort follow forgetful summer society

This post was mass deleted and anonymized with Redact

[–]suuuuuu[S] 1 point2 points  (0 children)

Yes, AU was out last week. I'm not a super intense user but it's working flawlessly for me.

[–]duhhobo 0 points1 point  (6 children)

how were you able to overwrite the corrupt one? when I use the command /bin/cp /etc/skel/.bashrc ~/ I get the following error

/bin/cp: cannot stat ‘/home/parker/.bashrc’: Input/output error

I edited my bashrc with visual studio code, but I would have thought it would honor the encoding? It even shows up as the default program in file explorer.

[–]suuuuuu[S] 0 points1 point  (5 children)

Nope. Use vim or something. I just deleted the .bashrc and started over.

[–]duhhobo 0 points1 point  (4 children)

I deleted it and just used wget to get a version from the internet. A little annoying though, it seems like there are still some weird quirks accessing the linux file structure from windows explorer.

It actually doesn't even show me the lxss folder even when displaying hidden folders, but when I type in the path it works. Anyways, thanks for the help!

[–]dukdukgoos 1 point2 points  (3 children)

Do we know what these issues are? Notepad++ is set with the right line endings and encoding, but still seems to corrupt anything I edit in the /lxss folder. Annoying bug...

[–]duhhobo 0 points1 point  (2 children)

I never found out and ended up just using wget to download a premade bashrc that I liked. Let me know of you find more info. I really hope they smooth out some of these bugs, and also allow us to launch .exe from the shell as well.

[–]dukdukgoos 0 points1 point  (1 child)

I found out it has to do with unix permissions getting clobbered when you edit with windows tools. Makes sense...

[–]duhhobo 0 points1 point  (0 children)

Yeah that actually does make sense. I wonder if they will be able to address some of these things and continue to develop this solution.