Closed dakrone closed 14 years ago
hmm, this is likely caused by something in your ENV that needs to be escaped. do you mind pasting output with debug enabled using cake -d
Here we go:
config: {}
vars: {
:env {
"STY" "9070.ttys001.Xanadu"
"TERM" "xterm-color"
"TERMCAP" "SC|screen-bce|VT 100/ANSI X3.64 virtual terminal:\\\n\t:DO=\
\E[%dB:LE=\\E[%dD:RI=\\E[%dC:UP=\\E[%dA:bs:bt=\\E[Z:\\\n\t:cd=\\E[J:ce=\\E[K:cl=\\E[H\\E[J:cm=\\E[%i%d;%dH:ct=\\E[3g:\\\n\t:do=^J:nd=\\
E[C:pt:rc=\\E8:rs=\\Ec:sc=\\E7:st=\\EH:up=\\EM:\\\n\t:le=^H:bl=^G:cr=^M:it#8:ho=\\E[H:nw=\\EE:ta=^I:is=\\E)0:\\\n\t:li#66:co#135:am:xn:
xv:LP:sr=\\EM:al=\\E[L:AL=\\E[%dL:\\\n\t:cs=\\E[%i%d;%dr:dl=\\E[M:DL=\\E[%dM:dc=\\E[P:DC=\\E[%dP:\\\n\t:im=\\E[4h:ei=\\E[4l:mi:IC=\\E[%
d@:ks=\\E[?1h\\E=:\\\n\t:ke=\\E[?1l\\E>:vi=\\E[?25l:ve=\\E[34h\\E[?25h:vs=\\E[34l:\\\n\t:ti=\\E[?1049h:te=\\E[?1049l:us=\\E[4m:ue=\\E[2
4m:so=\\E[3m:\\\n\t:se=\\E[23m:md=\\E[1m:mr=\\E[7m:me=\\E[m:ms:\\\n\t:Co#8:pa#64:AF=\\E[3%dm:AB=\\E[4%dm:op=\\E[39;49m:AX:\\\n\t:as=\\E
(0:ae=\\E(B:\\\n\t:ac=\\140\\140aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~..--++,,hhII00:\\\n\t:k0=\\E[10~:k1=\\EOP:k2=\\EOQ:k3=\
\EOR:k4=\\EOS:k5=\\E[15~:\\\n\t:k6=\\E[17~:k7=\\E[18~:k8=\\E[19~:k9=\\E[20~:k;=\\E[21~:\\\n\t:F1=\\E[23~:F2=\\E[24~:F3=\\E[25~:F4=\\E[2
6~:F5=\\E[28~:\\\n\t:F6=\\E[29~:F7=\\E[31~:F8=\\E[32~:F9=\\E[33~:FA=\\E[34~:\\\n\t:kb=^H:kh=\\E[1~:@1=\\E[1~:kH=\\E[4~:@7=\\E[4~:kN=\\E
[6~:\\\n\t:kP=\\E[5~:kI=\\E[2~:kD=\\E[3~:ku=\\EOA:kd=\\EOB:kr=\\EOC:\\\n\t:kl=\\EOD:km:"
"WINDOW" "2"
"SHELL" "zsh"
"PATH" "/Users/hinmanm/.rvm/gems/ruby-1.9.1-p378/bin:/Users/hinmanm/.rvm/gems/ruby-1.9.1-p378@global/bin:/Users/hinmanm/.rvm/rubies/ruby-1.9.1-p378/bin:/U
sers/hinmanm/.rvm/bin:/usr/local/bin/blackbag:/Users/hinmanm/bin:/opt/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local
/git/bin:/usr/X11/bin:/usr/local/sbin:/usr/libexec:/opt/local/sbin:/usr/local/mysql/bin:/var/lib/gems/1.8/bin:/opt/local/lib/postgresql
84/bin:/Users/hinmanm/.gem/ruby/1.8/bin:/Users/hinmanm/.gem/ruby/1.9/bin:/Users/hinmanm/src/chrisbin:/Users/hinmanm/src/chrisbin/ruby:/
opt/apache-maven-2.2.1:/opt/apache-maven-2.2.1"
"TMPDIR" "/var/folders/xi/xis+13JHGvmCUlh5cRNvY++++TI/-Tmp-/"
"HOME" "/Users/hinmanm"
"USER" "hinmanm"
"LOGNAME" "hinmanm"
"DISPLAY" "/tmp/launch-YLgQk8/org.x:0"
"SSH_AUTH_SOCK" "/tmp/launch-VT6vm8/Listeners"
"Apple_PubSub_Socket_Render" "/tmp/launch-89AxNb/Render"
"__CF_USER_TEXT_ENCODING" "0x1F5:0:0"
"SECURITYSESSIONID" "32a292"
"COMMAND_MODE" "legacy"
"TERM_PROGRAM" "iTerm.app"
"LC_COLLATE" "en_US.utf-8"
"LC_CTYPE" "en_US.utf-8"
"LC_MESSAGES" "en_US.utf-8"
"LC_TIME" "en_US.utf-8"
"LC_MONETARY" "en_US.utf-8"
"LC_NUMERIC" "en_US.utf-8"
"PWD" "/Users/hinmanm"
"LANG" "en_US.utf-8"
"SHLVL" "2"
"OLDPWD" "/Users/hinmanm/pkgs/279"
"RUBYLIB" "/Users/hinmanm/src/chrisbin/ruby"
"RUBYOPT" "rubygems"
"JAVA_HOME" "/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home"
"CLOJURE_EXT" "/Users/hinmanm/.vimclojure:/Users/hinmanm/.cljr/lib:./lib:./classes:./src:." "CLOJURE_OPTS" "-server -Xmx1024m -XX:+UseConcMarkSweepGC -XX:+HeapDumpOnOutOfMemoryError" "JVM_OPTS" "-server -Xmx512m -XX:+UseConcMarkSweepGC -XX:+HeapDumpOnOutOf
MemoryError"
"MANPATH" "/usr/share/man:/usr/local/share/man:/usr/local/git/share/man:/usr/X11/share/man:/usr/local/man:/opt/local/share
/man:/Users/hinmanm/.rvm/man:/usr/local/man:/opt/local/share/man:/Users/hinmanm/.rvm/man"
"EDITOR" "vim"
"PAGER" "less"
"CVSROOT" ":pserver:*******************************:/home/cvsroot/repository"
"CVSEDITOR" "vim"
"RSPEC" "true"
"_resty_host" ""
"_resty_path" ""
"rvm_path" "/Users/hinmanm/.rvm"
"rvm_patches_path" "/Users/hinmanm/.rvm/patches"
"rvm_rubies_path" "/Users/hinmanm/.rvm/rubies"
"rvm_scripts_path" "/Users/hinmanm/.rvm/scripts"
"rvm_archives_path" "/Users/hinmanm/.rvm/archives"
"rvm_src_path" "/Users/hinmanm/.rvm/src"
"rvm_log_path" "/Users/hinmanm/.rvm/log"
"rvm_bin_path" "/Users/hinmanm/.rvm/bin"
"rvm_gems_path" "/Users/hinmanm/.rvm/gems"
"rvm_config_path" "/Users/hinmanm/.rvm/config"
"rvm_tmp_path" "/Users/hinmanm/.rvm/tmp"
"rvm_hooks_path" "/Users/hinmanm/.rvm/hooks"
"rvm_gems_cache_path" "/Users/hinmanm/.rvm/gems/cache"
"rvm_gemset_separator" "@"
"rvm_gemsets_path" "/Users/hinmanm/.rvm/gemsets"
"rvm_repo_path" "/Users/hinmanm/.rvm/repos"
"rvm_patchsets_path" "/Users/hinmanm/.rvm/patchsets"
"rvm_selfcontained" "1"
"rvm_version" "0.1.46"
"RUBY_VERSION" "ruby-1.9.1-p378"
"GEM_HOME" "/Users/hinmanm/.rvm/gems/ruby-1.9.1-p378"
"GEM_PATH" "/Users/hinmanm/.rvm/gems/ruby-1.9.1-p378:/Users/hinmanm/.rvm/gems/ruby-1.9.1-p378@global"
"BUNDLE_PATH" "/Users/hinmanm/.rvm/gems/ruby-1.9.1-p378"
"MY_RUBY_HOME" "/Users/hinmanm/.rvm/rubies/ruby-1.9.1-p378"
"IRBRC" "/Users/hinmanm/.irbrc"
"rvm_ruby_string" "ruby-1.9.1-p378"
"__shell_array_start" "1"
"rvm_interactive" "1"
"P4PORT" "**************:1666"
"P4USER" "hinmam"
"P4CLIENT" "hinmam_Xanadu"
"P4DIFF" "colordiff"
"PS1" "%{\033[30m%}\xE2\x80\xB9 %{\033[34m%}%~%{\033[30m%} %{\033[32m%}%{\033[30m%}\xE2\x80\xBA %{\033[32m%}\xE2\x88\xB4%{\033[00m%} "
"RPROMPT" "%{\033[00m%}"
"_" "/Users/hinmanm/.rvm/gems/ruby-1.9.1-p378/bin/cake"
"rvm_action" "use"
"rvm_ruby_gem_path" "/Users/hinmanm/.rvm/gems/ruby-1.9.1-p378:/Users/hinmanm/.rvm/gems/ruby-1.9.1-p378@global"
"rvm_ruby_gem_home" "/Users/hinmanm/.rvm/gems/ruby-1.9.1-p378"
"rvm_ruby_interpreter" "ruby"
"rvm_ruby_version" "1.9.1"
"rvm_ruby_repo_url" "http://svn.ruby-lang.org/repos/ruby"
"rvm_ruby_package_name" "ruby-1.9.1-p378"
"rvm_ruby_patch_level" "p378"
"rvm_ruby_configure_flags" ""
"rvm_release_version" "1"
"rvm_major_version" "9"
"rvm_minor_version" "1"
"rvm_ruby_binary" "/Users/hinmanm/.rvm/rubies/ruby-1.9.1-p378/bin/ruby"
"rvm_ruby_home" "/Users/hinmanm/.rvm/rubies/ruby-1.9.1-p378"
"rvm_ruby_log_path" "/Users/hinmanm/.rvm/log/ruby-1.9.1-p378"
"rvm_ruby_src_path" "/Users/hinmanm/.rvm/src/ruby-1.9.1-p378"
"rvm_ruby_irbrc" "/Users/hinmanm/.rvm/rubies/ruby-1.9.1-p378/.irbrc"
"rvm_ruby_selected_flag" "1"}
:pwd "/Users/hinmanm"
:args ["default" "-d"]
:opts {:d [""]}
:script "/Users/hinmanm/.rvm/gems/ruby-1.9.1-p378/bin/cake"}
[cake] running from gem
[deps] sending: [:deps "READLINE__0.476668787914073"]
Then, ending with the same exception from above (not pasted for reading sanity sake).
I attempted to edit that so it was human readable, let me know if you want the un-edited wall-o-text version.
hmm, i think your PS1 is triggering the error. what does echo $PS1
print?
So, perhaps because of the unicode in my prompt?
not sure. i'm just trying to reproduce the problem. could you send the line in your zsh init script that sets PS1?
this is similar to this issue: http://github.com/ninjudd/cake/issues/closed#issue/22 i just need to add additional escape characters to the ruby client script
Sure:
export PS1="%{$fg[grey]%}‹ %{$fg[blue]%}%~%{$fg[grey]%} %{$fg[green]%}$(get-git-branch)%{$fg[grey]%}› %{$fg[green]%}∴%{$reset_color%} "
hmm, this works for me. it must be something else in your init that is triggering it:
setopt ALL_EXPORT
autoload colors zsh/terminfo
colors
export PS1="%{$fg[grey]%}‹ %{$fg[blue]%}%~%{$fg[grey]%} %{$fg[green]%}master%{$fg[grey]%}› %{$fg[green]%}∴%{$reset_color%} "
‹ ~/projects/jiraph master› ∴ cake -d
config: {"subproject.clojure-useful"=>"/Users/justin/projects/useful", "clj-stacktrace"=>"color", "project.arch"=>"x86_64", "project.java_opts"=>"-d64", "subproject.clojure-protobuf"=>"/Users/justin/projects/protobuf", "cake.disable-auto-deps"=>"true"}
vars: {:pwd "/Users/justin/projects/jiraph" :shellenv {"bold_color" "\033[01m" "CLASSPATH" "./*:./lib/*:./src:./src/clj:./classes:/Users/justin/lib/java/*" "MANPATH" "/usr/share/man:/usr/local/share/man:/usr/X11/share/man:/usr/local/man:/usr/X11/man:/usr/local/git/man" "CVS_RSH" "ssh" "OLDPWD" "/Users/justin/projects/jiraph" "USER" "justin" "Apple_PubSub_Socket_Render" "/tmp/launch-wekgGa/Render" "TMPDIR" "/var/folders/17/17Xm62cBEjyMXhEnHcVYdk+++TI/-Tmp-/" "PS1" "%{\033[30m%}\342\200\271 %{\033[34m%}%~%{\033[30m%} %{\033[32m%}master%{\033[30m%}\342\200\272 %{\033[32m%}\342\210\264%{\033[00m%} " "PAGER" "less" "TERM_PROGRAM_VERSION" "273" "TERM" "xterm-color" "GENI" "/Users/justin/projects/geni" "CODE" "/Users/justin/code" "RAILS_ENV" "development" "SHLVL" "2" "EDITOR" "emacs" "__CF_USER_TEXT_ENCODING" "0x1F5:0:0" "GEM_HOME" "/Users/justin/.gems" "COMMAND_MODE" "unix2003" "SHELL" "/bin/bash" "DISPLAY" "/tmp/launch-9Q7XHG/org.x:0" "LOGNAME" "justin" "PROJECTS" "/Users/justin/projects" "GRAPH" "/Users/justin/projects/graph" "LANG" "en_US.UTF-8" "PWD" "/Users/justin/projects/jiraph" "PATH" "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Users/justin/bin:/opt/local/bin:/usr/local/git/bin:/Users/justin/.gems/bin" "GIT_ALLOW_SUBMODULE_COMMITS" "1" "SSH_AUTH_SOCK" "/tmp/launch-50xgdy/Listeners" "_" "/Users/justin/bin/cake" "PROMPT_COMMAND" "" "HOME" "/Users/justin" "reset_color" "\033[00m" "YAMMER" "/Users/justin/projects/yammer" "TERM_PROGRAM" "Apple_Terminal"} :script "/Users/justin/bin/cake" :args ["default" "-d"] :opts {:d [""]}}
[cake] running from git checkout
[deps] project.clj version is 0.4.16-SNAPSHOT
[start] starting cake jvm
java -client -d32 -Dcake.project="/Users/justin/projects/jiraph" -cp "/Users/justin/projects/cake/src:/Users/justin/projects/cake/lib/*:src:src/clj:lib/dev/*:/Users/justin/.cake/lib/dev/*" -Djava.library.path="lib/dev/native" clojure.main -e "(use 'cake.core) (start-server 42701)"
[start] starting bake jvm
java -client -d32 -Dcake.project="/Users/justin/projects/jiraph" -d64 -cp "/Users/justin/projects/cake/bake:src:src/clj:classes:resources:dev:test:lib/*:lib/dev/*:/Users/justin/.cake/lib/dev/*" -Djava.library.path="lib/native:lib/dev/native" clojure.main -e "(use 'bake.core) (start-server 36892)"
[default] sending: [:default "READLINE__0.963488829319284"]
-------------------------------------------
cake autotest ;; Automatically run tests whenever your project code changes.
cake bin ;; Create a standalone console executable for your project.
...
my PS1 is different from yours in the debug output. do you have different color-related code than i do before you set PS1?
I also have this:
function precmd() {
title "zsh" "$USER@%m" "%55<...<%~"
# Set the git branch in prompt
export PS1="%{$fg[grey]%}‹ %{$fg[blue]%}%~%{$fg[grey]%} %{$fg[green]%}$(get-git-branch)%{$fg[grey]%}› %{$fg[green]%}∴%{$reset_color%} "
}
I noticed if I comment out the precmd in ~/.zshrc, spawn a new shell and do 'export PS1="$ "', I can run cake, so I believe it's something to do with the prompt/precmd.
Here's my full prompt section:
# autoloads
autoload -U compinit
autoload -U promptinit
autoload colors
colors
compinit
promptinit
### Prompt ###
setopt prompt_subst
export PS1="%{$fg[grey]%}‹ %{$fg[blue]%}%~%{$fg[grey]%} %{$fg[green]%}$(get-git-branch)%{$fg[grey]%}› %{$fg[green]%}∴%{$reset_color%} "
autoload -U promptinit
promptinit
export RPROMPT="%{$reset_color%}"
# format titles for screen and rxvt
function title() {
# escape '%' chars in $1, make nonprintables visible
a=${(V)1//\%/\%\%}
# Truncate command, and join lines.
a=$(print -Pn "%40>...>$a" | tr -d "\n")
case $TERM in
screen*)
print -Pn "\ek$a:$3\e\\" # screen title (in ^A")
;;
xterm-color*)
print -Pn "\ek$a:$3\e\\" # screen title (in ^A")
;;
xterm*|rxvt)
print -Pn "\e]2;$2 | $a:$3\a" # plain xterm title
;;
esac
}
# precmd is called just before the prompt is printed
function precmd() {
title "zsh" "$USER@%m" "%55<...<%~"
# Set the git branch in prompt
export PS1="%{$fg[grey]%}‹ %{$fg[blue]%}%~%{$fg[grey]%} %{$fg[green]%}$(get-git-branch)%{$fg[grey]%}› %{$fg[green]%}∴%{$reset_color%} "
}
# preexec is called just before any command line is executed
function preexec() {
title "$1" "$USER@%m" "%35<...<%~"
}
hmm, still works for me. i'm testing with ruby 1.9.2p0. perhaps the problem only appears in 1.9.1-p378?
Looks like it, I just tried it with 1.9.2p0 (using RVM) and it worked without a problem. 1.9.1 -> 1.9.2 bug?
i just reproduced it by setting an ENV var to an invalid unicode character in 1.9.2. i have a fix that will mangle the string in 1.9.1, but at least in won't blow up.
http://github.com/ninjudd/cake/commit/61d53478b1bbb9d5a186432451dea1424625a2a4
Awesome, that commit fixed the problem on 1.9.1p378, thanks!
Running a clean install of cake:
etc, etc, etc
Ruby version 1.9.1-p378