Comments (26)
Can you give more details about the issue you experienced?
from laptop.
Sure. I can send you the log file
from laptop.
Sorry this is piecemeal but I'm only allowed to attach images.
from laptop.
Thanks, those images are very helpful. It looks like the issue is with PhantomJS, which does not yet work on El Capitan. They are working on a new release, but in the meantime, I'll detect if El Capitan is running, and if so, disable phantomjs.
from laptop.
Thanks. It also seemed to have changed my username in terminal from phoebeespiritu to C02PT3MUFVH8%. Is that normal?
from laptop.
No, that is not normal. The script does not make such changes. Could you please try quitting and relaunching your Terminal, and/or restarting your computer?
from laptop.
Just rebooted and it still has the crazy username although it's now all lowercase.
from laptop.
Is the username different everywhere on your computer (i.e when you log in, in your Finder), or just in Terminal?
from laptop.
Nope, just in Terminal. Very weird.
On Mon, Oct 26, 2015 at 10:27 AM, Moncef Belyamani <[email protected]
wrote:
Is the username different everywhere on your computer (i.e when you log
in, in your Finder), or just in Terminal?—
Reply to this email directly or view it on GitHub
#30 (comment).
from laptop.
What is the output of whoami
in the Terminal?
from laptop.
Also, can you copy and paste the contents of your .zshrc
, .bashrc
and .bash_profile
? They should be in your home folder. You can print the contents like this: cat ~/.zshrc
.
from laptop.
whoami
phoebeespiritu
.zshrc
export PATH="$HOME/.bin:$PATH"
.bash_profile
# Environment Variables
# =====================
# Library Paths
# These variables tell your shell where they can find certain
# required libraries so other programs can reliably call the variable name
# instead of a hardcoded path.
# NODE_PATH
# Node Path from Homebrew I believe
export NODE_PATH="/usr/local/lib/node_modules:$NODE_PATH"
# Those NODE & Python Paths won't break anything even if you
# don't have NODE or Python installed. Eventually you will and
# then you don't have to update your bash_profile
# Configurations
# GIT_MERGE_AUTO_EDIT
# This variable configures git to not require a message when you merge.
export GIT_MERGE_AUTOEDIT='no'
# Editors
# Tells your shell that when a program requires various editors, use sublime.
# The -w flag tells your shell to wait until sublime exits
export VISUAL="subl -w"
export SVN_EDITOR="subl -w"
export GIT_EDITOR="subl -w"
export EDITOR="subl -w"
# Paths
# The USR_PATHS variable will just store all relevant /usr paths for easier usage
# Each path is seperate via a : and we always use absolute paths.
# A bit about the /usr directory
# The /usr directory is a convention from linux that creates a common place to put
# files and executables that the entire system needs access too. It tries to be user
# independent, so whichever user is logged in should have permissions to the /usr directory.
# We call that /usr/local. Within /usr/local, there is a bin directory for actually
# storing the binaries (programs) that our system would want.
# Also, Homebrew adopts this convention so things installed via Homebrew
# get symlinked into /usr/local
export USR_PATHS="/usr/local:/usr/local/bin:/usr/local/sbin:/usr/bin"
# Hint: You can interpolate a variable into a string by using the $VARIABLE notation as below.
# We build our final PATH by combining the variables defined above
# along with any previous values in the PATH variable.
# Our PATH variable is special and very important. Whenever we type a command into our shell,
# it will try to find that command within a directory that is defined in our PATH.
# Read http://blog.seldomatt.com/blog/2012/10/08/bash-and-the-one-true-path/ for more on that.
export PATH="$USR_PATHS:$PATH"
# If you go into your shell and type: $PATH you will see the output of your current path.
# For example, mine is:
# /Users/avi/.rvm/gems/ruby-1.9.3-p392/bin:/Users/avi/.rvm/gems/ruby-1.9.3-p392@global/bin:/Users/avi/.rvm/rubies/ruby-1.9.3-p392/bin:/Users/avi/.rvm/bin:/usr/local:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/local/mysql/bin:/usr/local/share/python:/bin:/usr/sbin:/sbin:
# Helpful Functions
# =====================
# A function to CD into the desktop from anywhere
# so you just type desktop.
# HINT: It uses the built in USER variable to know your OS X username
# USE: desktop
# desktop subfolder
function desktop {
cd /Users/$USER/Desktop/$@
}
# A function to easily grep for a matching process
# USE: psg postgres
function psg {
FIRST=`echo $1 | sed -e 's/^\(.\).*/\1/'`
REST=`echo $1 | sed -e 's/^.\(.*\)/\1/'`
ps aux | grep "[$FIRST]$REST"
}
# A function to extract correctly any archive based on extension
# USE: extract imazip.zip
# extract imatar.tar
function extract () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) rar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*) echo "'$1' cannot be extracted via extract()" ;;
esac
else
echo "'$1' is not a valid file"
fi
}
# Aliases
# =====================
# LS
alias l='ls -lah'
# Git
alias gst="git status"
alias gl="git pull"
alias gp="git push"
alias gd="git diff | mate"
alias gc="git commit -v"
alias gca="git commit -v -a"
alias gb="git branch"
alias gba="git branch -a"
alias gcam="git commit -am"
alias gbb="git branch -b"
# Case-Insensitive Auto Completion
bind "set completion-ignore-case on"
# Final Configurations and Plugins
# =====================
# Git Bash Completion
# Will activate bash git completion if installed
# via homebrew
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
# RVM
# Mandatory loading of RVM into the shell
# This must be the last line of your bash_profile always
[[ -s "/Users/$USER/.rvm/scripts/rvm" ]] && source "/Users/$USER/.rvm/scripts/rvm" # This loads RVM into a shell session.
# Setting PATH for Python 3.4
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.4/bin:${PATH}"
export PATH
# Setting PATH for Python 3.4
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.4/bin:${PATH}"
export PATH
No .bashrc
file
from laptop.
Since whoami
worked, it sounds like a shell issue to me. It looks like you have a custom .bash_profile
, and although I don't see anything in there that would change your prompt, my guess is that your bash config is causing this. What happens if you change your shell to zsh?
chsh -s "$(which zsh)"
from laptop.
I tried chsh -s "$(which zsh)"
. Here's what I got:
chsh: no changes made
Yup, I had removed the .bash_profile
to see if that was causing it but didn't seem to do anything.
from laptop.
That's strange. It should prompt you to enter your password. Did you make any changes to your laptop before you ran the script?
from laptop.
Oh, sorry. It did prompt me for my password. After I entered my password, I got
chsh: no changes made
I added the following .bash_profile
prior to running the script:
# Case-Insensitive Auto Completion
bind "set completion-ignore-case on"
# Final Configurations and Plugins
# =====================
# Git Bash Completion
# Will activate bash git completion if installed
# via homebrew
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
Also, I had a curious issue one day (the day after I did added .bash_profile
) whereby Terminal wouldn't allow me to type or paste in the letter 'o'. It would beep every time I tried to type an 'o'. When I tried to paste in a string that contained Os, it would strip out the O and beeped for every O it removed.
from laptop.
Very strange. I wonder if GSA IT made some changes that would cause this.
Perhaps no shell changes were made because you are already using zsh? What does echo $SHELL
say?
from laptop.
Got this from echo $SHELL
/bin/zsh
from laptop.
ok, that makes sense. Do you have a .zprofile
, .profile
, or .zlogin
?
from laptop.
.zprofile
, .profile
or .zlogin
none of the above
from laptop.
I think I understand what's going on. By default, the zsh prompt will not show you your username or your current directory. It just displays your computer's name, followed by a percent sign. I've been meaning to add a line to .zshrc
so that it customizes your prompt to be more like the default bash prompt.
Can you try adding the following to your .zshrc
, then quit and restart Terminal?
precmd () { PS1="%{%F{166}%}[%~] %{%F{65}%}$(rvm-prompt) %{%f%}$ " }
from laptop.
Okay, I added to .zshrc
, restarted and got this:
precmd: command not found: rvm-prompt
[~] $
from laptop.
Right. Because the script never completed.
Please try the following:
curl --remote-name https://raw.githubusercontent.com/18F/laptop/master/mac
Open the mac file wherever you downloaded it.
Comment out line 158 (brew_install_or_upgrade 'phantomjs'
)
Add the following line around line 222 (before brew_tap 'pivotal/tap'
):
append_to_file "$HOME/.zshrc" 'precmd () { PS1="%{%F{166}%}[$(whoami)][%~] %{%F{65}%}$(rvm-prompt) %{%f%}$ " }'
Save the file.
bash mac 2>&1 | tee ~/laptop.log
The script should now complete, and when you quit and restart Terminal (or open a new tab), your prompt should look something like this:
[your username in orange] [your current directory in orange] your current ruby version in green $
You can then customize your prompt the way you like it by modifying that precmd line. If you want to use different colors, replace 166
and 65
in that line with any of the possible 256 Xterm colors:
https://upload.wikimedia.org/wikipedia/commons/9/95/Xterm_color_chart.png
from laptop.
Alternatively, you can try out a bunch of different themes by installing oh-my-zsh. If you do go that route, you'll first need to make a backup of your final .zshrc
that the script produces and paste in the contents (except for the precmd line) at the end of the new .zshrc
that oh-my-zsh creates.
It's on my to-do list to create a tutorial for customizing your prompt.
from laptop.
When I run any command, I keep getting precmd: command not found: rvm-prompt
at the end.
from laptop.
Yay, finally finished the installation. Terminal prompt looks like what you described:
[your username in orange] [your current directory in orange] your current ruby version in green $
phew!
from laptop.
Related Issues (20)
- Is there a more robust way to automatically fetch the latest rules? HOT 1
- Install script fails upon first prompt HOT 6
- Enhancement: run command to disable Sketch versioning HOT 1
- Add Jekyll? HOT 2
- seekret-rules for cloud.gov tech
- Move to a new CI/CD system HOT 1
- Script fails on Xcode HOT 2
- Xcode command line tool instructions HOT 5
- Fish support HOT 2
- nvm install syntax is incorrect
- Migrate to CircleCI 2.0 HOT 1
- Minor issues with script (invalid option error, permissions)
- Remove GitHub desktop app
- Update README and script comments on rbenv vs. chruby HOT 1
- Script fails on zipimport error while installing Python HOT 1
- Why I didn't use these tools HOT 19
- Use a maintained tool for preventing checking secrets into version control HOT 19
- seekrets-install BIN_LOCATION should be an option
- use rbenv instead of chruby for consistency with repo code HOT 4
- reduce scope/steps in the laptop script HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laptop.