better aptitude search
[distro-setup] / .bashrc
diff --git a/.bashrc b/.bashrc
index f7af595af12ffc90f6cdd55acacfe51585f37510..c88a065bfed4fbcf0238a9dc16cbcb9a6fbc04e3 100644 (file)
--- a/.bashrc
+++ b/.bashrc
 # So we need something else. Command lines and env variables sent across ssh are strictly limited.
 # We could override an obscure unused LC_var, like telephone, or we could transfer a file.
 # But I choose to set SendEnv and AcceptEnv ssh vars for BASH_LOGIN_SHELL.
+# In a private file, i have aliases for if $- == *i*, ssh -t, else ssh.
 
 [[ $- != *i* && ! $SSH_CONNECTION ]] && export BASH_LOGIN_SHELL=true
+
 if [[ $SSH_CONNECTION ]] \
    && [[ $- == *c* ]] \
    && [[ ! $SSH_TTY ]] \
@@ -502,10 +504,16 @@ else
         fi
     }
     pf() {
+        # scratch a very annoying itch.
+        # package description width as wide as the screen, and package name field small
+        # aptitude manual can't figure out how wide emacs terminal is,
+        # of course it doesn't consult the $COLUMNS variable...
+        # and in a normal terminal, it makes the package name field ridiculously big
+        # also, remove that useless dash before the description
         if [[ $EUID == 0 ]]; then
-            aptitude search "$@"
+            aptitude -F "%c%a%M %p %$((COLUMNS - 30))d" -w $COLUMNS search "$@"
         else
-            sudo aptitude search "$@"
+            sudo aptitude -F "%c%a%M %p %$((COLUMNS - 30))d" -w $COLUMNS search "$@"
         fi
     }
 fi