You are not logged in.

#1 2012-11-13 04:33:27

mrrhq
Member
Registered: 2012-11-07
Posts: 18

Some problem(s) with zsh and urxvt

So I'm having problems after importing my backup home directory. Several minor irks prevent me from using, for examle, even vim or nano on my machine now (I can always use a live CD).

So one of the problems I want to address is when I type in "zsh" after I log in, an error message comes up

/home/mrrhq/.zshrc:99: can't find terminal definition for urxvt

I had installed xterm because urxvt also wasn't working when I had X running, but xterm did, which is weird. I have searched for these problems on the Wiki, and forums, and search engines with no real avail. Maybe someone knows what my problem is.

I have other minor problems to solve. Like for some reason halt and reboot and shutting down and Home and End keys wont work with the terminal (I have to figure out how to configure this) and the colors doesn't work, my external media doesn't automatically mount, etc... but this is my most serious problem that prevents me from using my machine properly, so I hope someone can help. Are there any misconfiguration errors? Keep in mind that I'm migrating over my home directory which is a few months old from a Debian Sid system, and I'm trying to get it to work with Arch. So as this implies, it's not a completely smooth transition.

Thankfully I can at least use the cat command to show my config files.

.zshrc

# ZSH config file
# Author: Mr. R (mrrhq)
#
# This work is released to the Public Domain

#if [ -x "/usr/bin/tmux" ] -a [ -z "$TMUX"]; then
#  echo "Starting TMUX."
#  tmux
#fi

  setopt   AUTO_CD AUTO_PUSHD CDABLE_VARS \
           PUSHD_MINUS PUSHD_SILENT PUSHD_TO_HOME

  setopt   ALWAYS_TO_END AUTO_LIST AUTO_PARAM_KEYS GLOB_COMPLETE \
           LIST_ROWS_FIRST LIST_TYPES MENU_COMPLETE REC_EXACT LIST_PACKED
  unsetopt LIST_BEEP AUTO_PARAM_SLASH 

  setopt   BRACE_CCL EQUALS EXTENDED_GLOB GLOB \
           GLOB_DOTS MARK_DIRS NUMERIC_GLOB_SORT RC_EXPAND_PARAM
  unsetopt BAD_PATTERN CASE_GLOB

  setopt   HIST_APPEND EXTENDED_HISTORY HIST_IGNORE_ALL_DUPS \
           HIST_REDUCE_BLANKS HIST_SAVE_NO_DUPS INC_APPEND_HISTORY SHARE_HISTORY
  unsetopt HIST_BEEP

  setopt   CORRECT CORRECT_ALL FLOW_CONTROL MAIL_WARN \
           PATH_DIRS PATH_SCRIPT PRINT_EXIT_VALUE RC_QUOTES

  setopt   AUTO_RESUME LONG_LIST_JOBS HUP NOTIFY POSIX_JOBS
  unsetopt BG_NICE

# setopt   TRANSIENT_RPROMPT

  setopt   C_BASES EXEC FUNCTION_ARGZERO
# unsetopt SOURCE_TRACE XTRACE

# setopt   BASH_REMATCH BSD_ECHO KSH_ARRAYS POSIX_ALIASES 
# setopt   POSIX_IDENTIFIERS POSIX_STRINGS POSIX_TRAPS

  setopt   LOGIN 
# unsetopt ONE_CMD

  unsetopt BEEP

  zmodload -a zsh/stat stat
  zmodload -a zsh/zpty zpty
  zmodload -a zsh/zprof zprof
  zmodload -ap zsh/mapfile mapfile 2> /dev/null
  zmodload zsh/complist

  autoload colors zsh/terminfo
  autoload -U zcalc
  autoload -U compinit; compinit
  autoload -U promptinit; promptinit
  autoload -U incremental-complete-word

chpwd()
{
  [[ -t 1 ]] || return
  case $TERM in
    sun-cmd) print -Pn "\e]l%~\e\\"
  ;;
    *) print -Pn "\e]2;%~\a"
  ;;
  esac
}

colortest()
{
  T=" # "
  for FGs in " m" " 1m" " 30m" "1;30m" " 31m" "1;31m" " 32m" "1;32m" " 33m" "1;33m" \
	     " 34m" "1;34m" " 35m" "1;35m" " 36m" "1;36m" " 37m" "1;37m"; do
    FG=${FGs// /}
    echo -en "\033[$FG $T "
    for BG in 40m 41m 42m 43m 44m 45m 46m 47m; do
      echo -en "$EINS \033[$FG\033[$BG $T \033[0m";
    done
    echo
  done
}

if [[ "$terminfo[colors]" -gt 8 ]]; then
  colors
fi

for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE BLACK; do
  eval PR_B_$color="%{$terminfo[bold]$fg[${(L)color}]%}"
  eval PR_N_$color="%{$fg[${(L)color}]%}"
  (( count = $count + 1 ))
done

  ZDIR="$HOME/.zsh"

  BROWSER="xdg-open"
  EDITOR="vi"
  MAIL="/var/spool/mail/mrrhq1"
  MUTT_EDITOR="vi"
  PAGER="less"
  TERM="urxvt"

  FIGNORE=".o:~"
  GREP_OPTIONS="--color=auto"
  PATH="$HOME/bin:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:$PATH"

  HISTFILE="$ZDIR/history"
  HISTSIZE=9999
  SAVEHIST=9999

  HOSTNAME="`hostname`"

  LANGUAGE="en_US"
  LC_ALL="en_US.UTF-8"
  LANG="en_US.UTF-8"
  LC_CTYPE=C

  PR_N_NOCOL="%{$terminfo[sgr0]%}"
  PS1="${PR_B_WHITE}┌%B[%b%(!.${PR_B_RED}root.${PR_N_WHITE}user)${PR_B_RED}%B@%b${PR_N_RED}%m${PR_B_WHITE}%B][%b${PR_N_WHITE}%~${PR_B_WHITE}%B]%b
└%B[%b${PR_N_WHITE}%#${PR_B_WHITE}%B]: %b${PR_N_NOCOL}"
  PS2=" ${PR_B_WHITE}[${PR_N_WHITE}%N${PR_B_WHITE}]${PR_N_NOCOL} "
  PS3=" >"
  RPS1="${PR_B_WHITE}%B[%b${PR_N_RED}%D${PR_B_WHITE}%B][%b${PR_B_RED}%*${PR_B_WHITE}%B]%b${PR_N_NOCOL}"

  SDL_AUDIODRIVER=alsa

  TZ="America/Vancouver"

  bindkey "^?"    backward-delete-char
  bindkey "^[OH"  beginning-of-line
  bindkey "^[OF"  end-of-line
  bindkey "^[[5~" up-line-or-history
  bindkey "^[[6~" down-line-or-history
  bindkey "^r"    history-incremental-search-backward
  bindkey " "     magic-space 
  bindkey "^I"    complete-word
  bindkey "^X^I" expand-or-complete-prefix

  zstyle ":completion::complete:*" use-cache on
  zstyle ":completion::complete:*" cache-path $ZDIR/cache/$HOST

  zstyle ":completion:*" list-colors ${(s.:.)LS_COLORS}
  zstyle ":completion:*" list-prompt \
	 "%SAt %p: Hit TAB for more, or the character to insert%s"
  zstyle ":completion:*" menu select=1 _complete _ignored _approximate
  zstyle -e ":completion:*:approximate:*" max-errors \
	    "reply=( $(( ($#PREFIX+$#SUFFIX)/2 )) numeric )"
  zstyle ":completion:*" select-prompt "%Current selection at: %p%s"

  # Completion Styles

  zstyle ":completion:*::::" completer _expand _complete _ignored _approximate
  zstyle ":completion:*:expand:*" tag-order all-expansions

  zstyle ":completion:*" verbose yes
  zstyle ":completion:*:descriptions" format "%B%d%b"
  zstyle ":completion:*:messages" format "%d"
  zstyle ":completion:*:warnings" format "No matches for: %d"
  zstyle ":completion:*:corrections" format "%B%d (errors: %e)%b"
  zstyle ":completion:*" group-name ""

  zstyle ":completion:*" matcher-list "m:{a-z}={A-Z}"
  zstyle ":completion:*:*:-subscript-:*" tag-order "indexes parameters"
  zstyle ":completion:*:processes" command "ps -au$USER"
  zstyle ":completion:*:*:kill:*:processes" list-colors "=(#b) #([0-9]#)*=0=01;31"

  zstyle ":completion:*:processes" command "ps ax -o pid,s,nice,stime,args | sed "/ps/d""
  zstyle ":completion:*:*:kill:*:processes" command "ps --forest -A -o pid,user,cmd"
  zstyle ":completion:*:processes-names" command "ps axho command"
  zstyle ":completion:*:urls" local "www" "/var/www/htdocs" "public_html"

  zstyle ":completion:*" hosts $(awk "/^[^#]/ {print $2 $3 $4 $5}" \
	 /etc/hosts | grep -v ip6- && grep "^#%" /etc/hosts | awk -F% "{print $2}") 
  zstyle ":completion:*:*:(^rm):*:*files" ignored-patterns "*?.o" "*?.c~" "*?.old" "*?.pro"

  zstyle ":completion:*:functions" ignored-patterns "_*"

  zstyle ":completion:*:scp:*" tag-order files users \
	 "hosts:-host hosts:-domain:domain hosts:-ipaddr IP\ Address *"
  zstyle ":completion:*:scp:*" group-order files all-files users hosts-domain \
	 hosts-host hosts-ipaddr
  zstyle ":completion:*:ssh:*" tag-order users \
	 "hosts:-host hosts:-domain:domain hosts:-ipaddr IP\ Address *"
  zstyle ":completion:*:ssh:*" group-order hosts-domain hosts-host users hosts-ipaddr
  zstyle "*" single-ignored show

  # Alias initialization
  alias a="alias"

  # Argument replacement
  a dia="dia --integrated"
  a ls="ls --color=auto"
  a man="man -I --nh --nj"
  a tmux="tmux -2"
  a alsamixer="alsamixer -g"
  a cutycapt="cutycapt --min-width=1920 --min-height=1080"

  # Microsoft stuff
  a cd..="cd .."
  a cls="clear"
  a del="rm"
  a deltree="rm -rd *"
  a md="mkdir"
  a rd="rm -d"

  # Command shortening
  a b="${BROWSER}"
  a c="clear"
  a d="date"
  a e="echo"
  a f="finger"
  a g="grep"
  a h="htop"
  a i="info"
  a j="jobs"
  a k="kill"
  a l="less"
  a m="man"
  a n="nmap"
  a o="cat"
  a p="ping"
  a q="exit"
  a s="ssh"
  a t="${TERM}"
  a u="who"
  a v="vim"
  a w="which"
  a x="exec"
  a y="yes"
  a z="zathura"
  a dm="dmesg"
  a eg="egrep"
  a hh="history"
  a ie="gimp-*"
  a ip="ifconfig"
  a iw="iwconfig"
  a pk="pkill"
  a re="read"
  a rb="shutdown -r 0"
  a rh="shutdown -h 0"
  a xy="Xephyr -ac -br -noreset -screen 960x540 :1"
  a amx="alsamixer"
  a ffi="find"
  a irc="irssi"
  a lsa="ls -Al"
  a lsd="ls -Al | awk ' /^d/ {print $9}'"
  a ncp="ncmpcpp"
  a aptg="sudo apt-get"
  a apti="aptg install"
  a aptp="aptg --purge remove"
  a aptr="aptg --reinstall install"
  a aptu="aptg update && (aptg -y upgrade; aptg -y dist-upgrade)"
  a aptar="aptg autoremove"

.Xresources

!!
! All terminal settings
!!

! Terminal colors

*background: rgba:0000/0000/0000/cdcd
*foreground: ff00/ffff

*color0:  rgba:6000/6000/6000/ffff
*color1:  rgba:cd00/0000/0000/ffff
*color2:  rgba:0000/cd00/0000/ffff
*color3:  rgba:cd00/cd00/0000/ffff
*color4:  rgba:4000/4000/cd00/ffff
*color5:  rgba:cd00/0000/cd00/ffff
*color6:  rgba:0000/cd00/cd00/ffff
*color7:  rgba:cd00/cd00/cd00/ffff

*color8:  rgba:0000/0000/0000/ffff
*color9:  rgba:ff00/2000/2000/ffff
*color10: rgba:2000/ff00/2000/ffff
*color11: rgba:ff00/ff00/2000/ffff
*color12: rgba:6000/6000/ff00/ffff
*color13: rgba:ff00/2000/ff00/ffff
*color14: rgba:2000/ff00/ff00/ffff
*color15: rgba:ff00/ff00/ff00/ffff

!!
! urxvt settings
!!

urxvt.depth: 32

urxvt.buffered: true
urxvt.geometry: 128x36

urxvt.underlineColor:     rgba:ff00/ff00/ff00/ffff
urxvt.highlightColor:     rgba:cd00/cd00/6000/ffff
urxvt.highlightTextColor: rgba:0000/0000/0000/ffff

urxvt.cursorColor:   rgba:ff00/ff00/ff00/ffff
urxvt.cursorColor2:  rgba:0000/0000/0000/ffff

!urxvt.reverseVideo: false

urxvt.jumpScroll: true
urxvt.skipScroll: false

urxvt.transparent: true

urxvt.fading:     20
urxvt.faceColor:  rgba:0000/0000/0000/ffff
urxvt.tintColor:  rgba:0000/0000/0000/0000
urxvt.shading:    20
!urxvt.blendType:  alphablend
!urxvt.blurRadius: 2

!urxvt.iconFile:

urxvt.scrollColor:  rgba:ff00/ff00/ff00/ffff
urxvt.troughColor:  rgba:6000/6000/6000/ffff
!urxvt.borderColor:

!urxvt.backgroundPixmap:

urxvt.path: ~/.config/awesome/themes/images

urxvt.font:           -*-terminus-medium-r-*-*-12-*-*-*-*-*-*-*
urxvt.boldFont:       -*-terminus-bold-r-*-*-12-*-*-*-*-*-*-*
!urxvt.italicFont:
!urxvt.boldItalicFont:

!urxvt.intensityStyles:

urxvt.title:    Terminal

!urxvt.iconName:

!urxvt.mapAlert:     true
!urxvt.urgentOnBell: true
urxvt.visualBell:   true

!urxvt.loginShell: true

!urxvt.*utmpInhibit:

!urxvt.*print-pipe:

urxvt.*scrollstyle: plain
urxvt.*thickness: 6
urxvt.*scrollBar: on

urxvt.*scrollBar_right:    true
urxvt.*scrollBar_floating: true
urxvt.*scrollBar_align:    centre
!urxvt.*scrollTtyOutput:    false
!urxvt.*scrollWithBuffer:   true
!urxvt.*scrollTtyKeypress:  true

urxvt.*savelines: 9999

urxvt.*internalBorder: 0
urxvt.*externalBorder: 0

urxvt.*borderLess: false
urxvt.*skipBuiltinGlyphs: false

urxvt.*termName: rxvt

!urxvt.*lineSpace: 0

!urxvt.*meta8:

urxvt.*mouseWheelScrollPage: false

urxvt.*pastableTabs: true

urxvt.*cursorBlink:     true
urxvt.*cursorUnderline: false

urxvt.*pointerBlank:      false
urxvt.*pointerColor:      rgba:ff00/ff00/ff00/ffff
urxvt.*pointerColor2:     rgba:0000/0000/0000/0000
urxvt.*pointerBlankDelay: 10

!urxvt.*backspacekey:
!urxvt.*deletekey:
!urxvt.*cutchars:

!urxvt.*preeditType:

!urxvt.*inputMethod:
!urxvt.*imLocale:
!urxvt.*imFont:

urxvt.*tripleclickwords: false

urxvt.*insecure: false

!urxvt.*modifier:

!urxvt.*answerbackString:

urxvt.*secondaryScreen: false
urxvt.*secondaryScroll: false

!urxvt.*hold: false

!urxvt.*chdir:

!urxvt.*keysym.sym:

!urxvt.*perl-ext-common:
!urxvt.*perl-ext:
!urxvt.*perl-eval:
!urxvt.*perl-lib:

!urxvt.*selection.pattern.idx:
!urxvt.*selection.autotransform.idx:

!urxvt.*searchable-scrollback: Scroll

!urxvt.*urlLauncher:

!urxvt.*transient-for:

!urxvt.*override-redirect:

!urxvt.*iso14755:    true
!urxvt.*iso14755_52: true

!Global terminal settings

*metaSendsEscape: true

Offline

#2 2012-11-13 05:45:10

Lord Bo
Member
Registered: 2012-11-11
Posts: 168

Re: Some problem(s) with zsh and urxvt

I don't think you really need to set the TERM Variable by hand. As far as I can see it, it is automatically set (maybe by the Terminal itself?) to the right value. However: the right value vor rxvt-unicode (ak urxvt) would be: rxvt-unicode-256color .

Benjamin

Offline

#3 2012-11-13 10:12:03

derhamster
Member
Registered: 2012-07-08
Posts: 86

Re: Some problem(s) with zsh and urxvt

I had similar problems once, which were caused by a wrong value for TERM.
Try adding

URxvt.termName: rxvt-unicode-256color

to your .Xresources

Offline

#4 2012-11-13 14:01:46

Lord Bo
Member
Registered: 2012-11-11
Posts: 168

Re: Some problem(s) with zsh and urxvt

I had similar problems once, which were caused by a wrong value for TERM.
Try adding
URxvt.termName: rxvt-unicode-256color
to your .Xresources

First remove the wrong definition in your .zshrc and try, if TERM is set automatically to the correct value.

Last edited by Lord Bo (2012-11-13 14:02:17)

Offline

#5 2012-11-13 15:02:27

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,094

Re: Some problem(s) with zsh and urxvt

mrrhq wrote:

.zshrc

  TERM="urxvt"

Never set $TERM in .zshrc or similar. It will break stuff 100% guaranteed. Let the TE set $TERM instead.


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#6 2012-11-13 15:43:32

Lord Bo
Member
Registered: 2012-11-11
Posts: 168

Re: Some problem(s) with zsh and urxvt

Hi Mr. Elendig,

this sounds interesting: What is TE? Could you give me a link? (The Problem about these Abbreviations is that they are always to short.)

Benjamin

Offline

#7 2012-11-13 16:17:49

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,094

Re: Some problem(s) with zsh and urxvt

TE == Terminal Emulator


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#8 2012-11-13 17:37:00

Lord Bo
Member
Registered: 2012-11-11
Posts: 168

Re: Some problem(s) with zsh and urxvt

Ah ok, then it is as I guessed, how TERM is set.

Offline

#9 2012-11-13 18:33:26

mrrhq
Member
Registered: 2012-11-07
Posts: 18

Re: Some problem(s) with zsh and urxvt

Hey, guys. Thanks for responding. I really didn't know I was so clueless about this stuff.
I really thought "urxvt" could be used as an alias or, what we called in Debian, an alternative, to the rxvt-unicode-256color command. I guess not? I'm still trying to set up "vi" to be Vim as well, and I'll read more of the Wiki to figure that stuff out with Arch.

So in the tty interface I can start zsh again just fine. That's old news. I removed the TERM setting and placed the resource in my .Xresources that derhamster said. Thanks.
I also replaced the line in my Openbox rc.xml and menu.xml for terminal opening commands (can I use $TERM for those?)

Now when I start Xorg (with Openbox running) I tried both urxvt-unicode-256color and urxvt but none of them work with Openbox. No terminal emulator pops up and no errors show that I can see.

Last edited by mrrhq (2012-11-13 18:34:29)

Offline

#10 2012-11-13 18:56:17

Lord Bo
Member
Registered: 2012-11-11
Posts: 168

Re: Some problem(s) with zsh and urxvt

urxvt is the command for invoking the rxvt-unicode terminal. I don't know, how Openbox menues work. Are you sure, that the rxvt-unicode package is installed? And if you want vi to be vim, why don't you just create an alias?

Last edited by Lord Bo (2012-11-13 18:57:01)

Offline

#11 2012-11-13 20:09:30

mrrhq
Member
Registered: 2012-11-07
Posts: 18

Re: Some problem(s) with zsh and urxvt

Wait, are you guys assuming I have AUR set up?
Anyway, I don't really need the 256 colors, so I just have rxvt-unicode installed.

Offline

#12 2012-11-13 20:19:41

mrrhq
Member
Registered: 2012-11-07
Posts: 18

Re: Some problem(s) with zsh and urxvt

Okay, I solved my problems with zsh and urxvt.
Apparently, I missed the error message when running urxvt that I wasn't using a proper font declaration in my Xresources with xft. (Debian doesn't use Xft by default, so I have to make them both compatible again.)

I thought rxvt would be smart and drop to the configs set up in fontconfig or something, not just fail to run because I didn’t choose the correct font. That's stupid.

Anyway, problems solved for now.

Last edited by mrrhq (2012-11-13 20:20:59)

Offline

#13 2012-11-14 11:36:00

Lord Bo
Member
Registered: 2012-11-11
Posts: 168

Re: Some problem(s) with zsh and urxvt

You could mark the thread as [SOLVED] .

Greetings

Benjamin

Offline

#14 2012-11-14 16:24:35

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,094

Re: Some problem(s) with zsh and urxvt

mrrhq wrote:

HI'm still trying to set up "vi" to be Vim as well, and I'll read more of the Wiki to figure that stuff out with Arch.

Don't do that. On arch vi is real vi (aka ex-vi) and not vim in compatible mode.

If you want to run vim then run vim. It is only one more character to type.

edit: also vim in vi compability mode, which it will be if you run it as vi, sucks. It disables almost all the usefull features.

Last edited by Mr.Elendig (2012-11-14 16:25:09)


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

Board footer

Powered by FluxBB