DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 30th May 2008
schrodinger's Avatar
schrodinger schrodinger is offline
Fdisk Soldier
 
Join Date: May 2008
Location: Ireland
Posts: 69
Thanked 2 Times in 2 Posts
Unhappy Backspace Annoyance

Hi all,

I need some help with backspace and ssh to certain boxes/devices.

When I ssh to some machines and firewall appliances the backspace won't work. CTRL-h does but I already have stty erase ^H in my ~/.bashrc.

I'm using rxvt-unicode (urxvt)

Code:
[username@purplehaze (501) ~]$ cat .bashrc 
stty erase 
if test -t 0; then
PS1="[\u@\h (\!) \w]\$ "

  if [ "$TERM" == "xterm" -o "$TERM" == "rxvt" ]; then
    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
  fi

  alias vi="vim"
  alias telnet="telnet -N"
	alias check_ssh="ssh -g -L18190:127.0.0.1:18190"

  source $HOME/.bash_completion

fi
Code:
[username@purplehaze (502) ~]$ cat .bash_completion 

##if [ "$PS1" ] && [[ $BASH_VERSION == 2.05* ]] ; then
if [ "$PS1" ]; then

	# A lot of the following one-liners were taken directly from the
	# completion examples provided with the bash 2.04 source distrib

	# Make directory commands see only directories
	complete -d cd mkdir rmdir pushd

	# Make file commands see only files
	complete -f cat less more ln strip vi vim rm ispell md5 wc
	complete -f -X '*.bz2' bzip2
	complete -f -X '!*.bz2' bunzip2
	complete -f -X '*.zip' zip
	complete -f -X '!*.zip' unzip
	complete -f -X '*.gz' gzip
	complete -f -X '*.Z' compress
	complete -f -X '!*.Z' uncompress
	shopt -s extglob
	complete -f -X '!*.+(Z|gz|tgz|Gz)' gunzip zcat zmore zgrep

	# kill sees only signals
	complete -A signal -P '-' kill killall

	# user commands see only users
	complete -u finger su usermod userdel passwd w id

	# bg completes with stopped jobs
	complete -A stopped -P '%' bg

	# other job commands
	complete -j -P '%' fg jobs disown

	# network commands complete with hostname
	HOSTFILE=$HOME/.bash_hosts
	complete -A hostname ssh telnet ftp ping fping host traceroute \
        	    nslookup nmap whois dnsq

	# export and others complete with shell variables
	complete -v export local readonly unset

	# set completes with set options
	complete -A setopt set

	# shopt completes with shopt options
	complete -A shopt shopt

	# helptopics
	complete -A helptopic help

	# unalias completes with aliases
	complete -a unalias
fi
Code:
[username@purplehaze (501) ~]$ cat .profile 
# $FreeBSD: src/share/skel/dot.profile,v 1.21 2002/07/07 00:00:54 mp Exp $
#
# .profile - Bourne Shell startup script for login shells
#
# see also sh(1), environ(7).
#

# remove /usr/games and /usr/X11R6/bin if you want
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin:$HOME/bin; export PATH

# Setting TERM is normally done through /etc/ttys.  Do only override
# if you're sure that you'll never log in via telnet or xterm or a
# serial line.
# Use cons25l1 for iso-* fonts
# TERM=cons25; 	export TERM

BLOCKSIZE=K;							export BLOCKSIZE
EDITOR=vim;   							export EDITOR
PAGER=less;  							export PAGER
LANG=en_IE.UTF-8;						export LANG
LC_ALL=en_IE.UTF-8;						export LC_ALL
JRE_HOME=/usr/local/diablo-jre1.5.0;	export JRE_HOME
JDK_HOME=/usr/local/diablo-jdk1.5.0;	export JDK_HOME

# set ENV to a file invoked each time sh is started for interactive use.
ENV=$HOME/.shrc; export ENV

[ -x /usr/games/fortune ] && /usr/games/fortune freebsd-tips
Code:
[username@purplehaze (504) ~]$ env
fvwm_icon=/home/username/.fvwm/icons
SHELL=/usr/local/bin/bash
TERM=rxvt
FVWM_USERDIR=/home/username/.fvwm
HOSTDISPLAY=purplehaze.kerna.ie:0.0
fvwm_term=/usr/local/bin/urxvt
WINDOWID=33554439
fvwm_mail=/usr/local/bin/claws-mail
LC_ALL=en_IE.UTF-8
JRE_HOME=/usr/local/diablo-jre1.5.0
USER=conor
fvwm_webbrowser=/usr/local/bin/firefox
ENV=/home/conor/.shrc
fvwm_video_player=/usr/local/bin/mplayer
PAGER=less
FTP_PASSIVE_MODE=YES
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin:/home/username/bin
MAIL=/var/mail/username
BLOCKSIZE=K
PWD=/home/username
INPUTRC=/usr/local/etc/inputrc
fvwm_scrpt=/home/username/.fvwm/scripts
EDITOR=vim
LANG=en_IE.UTF-8
fvwm_media_player=/usr/local/bin/xmms
fvwm_img=/home/username/.fvwm/images
COLORFGBG=15;default
JDK_HOME=/usr/local/diablo-jdk1.5.0
HOME=/home/username
SHLVL=2
TERMINFO=/usr/local/share/misc/terminfo.db
fvwm_wallpapers=/home/username/.fvwm/wallpaper
LOGNAME=username
FVWM_MODULEDIR=/usr/local/libexec/fvwm/2.5.26
WINDOWPATH=9
DISPLAY=:0.0
COLORTERM=rxvt-xpm
XAUTHORITY=/home/username/.Xauthority
_=/usr/bin/env
No inputrc being used.
__________________
It was a new day yesterday, but it's an old day now.
Reply With Quote
  #2   (View Single Post)  
Old 30th May 2008
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Old man from scene 24
 
Join Date: Apr 2008
Location: Eindhoven, Netherlands
Posts: 2,074
Thanked 198 Times in 156 Posts
Default

Code:
[~]# bindkey | grep backward-delete-char
"^H"           ->  backward-delete-char
"^?"           ->  backward-delete-char
I know little about bash, so I can't really help you with that, but it seems the sequences ^H and ^? need to be binded to backspace...
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #3   (View Single Post)  
Old 3rd June 2008
schrodinger's Avatar
schrodinger schrodinger is offline
Fdisk Soldier
 
Join Date: May 2008
Location: Ireland
Posts: 69
Thanked 2 Times in 2 Posts
Default

Yes, I have been trying to do that by putting in stty erase "^H" and "^?" but I didn't realise that I might be able to bind them to both.
__________________
It was a new day yesterday, but it's an old day now.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:05 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick