home *** CD-ROM | disk | FTP | other *** search
/ ftp.hypersurf.com / ftp.hypersurf.com.tar / ftp.hypersurf.com / pub / users / r / rstone / ksh_pfkeys
Text File  |  1996-08-20  |  2KB  |  82 lines

  1.  
  2. set -o ignoreeof
  3. set -o emacs
  4.  
  5. alias __H=''            # home key -
  6. alias __A=''            # up arrow - previous command
  7. alias __B=''            # down arrow - next command
  8. alias __C=''            # right arrow - move cursor right
  9. alias __D=''            # left arrow - move cursor left
  10. alias __P=''            # delete key - delete character
  11.  
  12. alias __0='\0'
  13. alias __1='\1'
  14. alias __2='\2'
  15. alias __3='\3'
  16. alias __4='\4'
  17. alias __5='\5'
  18. alias __6='\6'
  19. alias __7='\7'
  20. alias __8='\8'
  21. alias __9='\9'
  22.  
  23. pfx=' #pf
  24. '
  25.  
  26. alias __q="$pfx"        # aixterm
  27. alias __z="$pfx"        # xterm -sf
  28. if [[ "power" = "$(arch)" ]]; then
  29.     alias __~="$pfx"    # xterm +sf
  30. fi
  31.  
  32. #
  33. # aixterm pfkey definitions
  34. #    001-012
  35. #    013-024 (shift)
  36. #    025-036 (ctl)
  37. #    037-048 (alt)
  38. alias pf001='#'
  39. alias pf002='#'
  40. alias pf003='#'
  41. alias pf004='#'
  42. alias pf005='#'
  43. alias pf006='#'
  44. alias pf007='#'
  45. alias pf008='fc -e - -2'
  46. # pf009 function
  47. alias pf010='#'
  48. alias pf011='#'
  49. alias pf012="clear"
  50. #
  51. # xterm -sf pfkey definitions
  52. #    224-233, 192, 193
  53. alias pf193=$(whence pf012)            # pf12
  54. alias pf235=$(whence pf012)            # pf12 for sun
  55.  
  56. #
  57. # xterm +sf pfkey definitions
  58. #    11-15, 17-21, 23, 24
  59. alias pf24=$(whence pf012)            # pf12
  60.  
  61. #
  62. # query pfkeys
  63. #
  64. alias qpf='alias | grep ^pf'
  65. #
  66. # "whence" pfkey function, uses command line as argument
  67. function pf009 {
  68. line=$(fc -nl -1 -1 | sed -n 's/^    #//p')    # strip leading tab & # character
  69.  
  70. if [[ -n "$line" ]]; then        # anything there?
  71.     set $line            # parse
  72.     y=$(whence -v $1)
  73.     x=$(whence $1)
  74.     if [[ "$y" != "${y%${x}}" ]]; then
  75.         line=${x}$(fc -nl -1 -1 | sed -e 's/^    #[^ ]*//')
  76.     fi
  77.     print -s "#$line"
  78.     print -s "pf009"            # place holder, use command name
  79.     whence -v $1
  80. fi
  81. }
  82.