Customize adb prompt

How to reduce the length of the path printed before the shell prompt opened with adb shell ? My problem is that it is so long that I can no longer see my commands, because it does not automatically interrupt the line. I would prefer something like the name of the current directory or an example of abstract code.

sh -v on an android phone gives me

 # Copyright (c) 2010 # Thorsten Glaser < t.glaser@tarent.de > # This file is provided under the same terms as mksh. #- # Minimal /system/etc/mkshrc for Android : ${TERM:=vt100} ${HOME:=/data} ${MKSH:=/system/bin/sh} ${HOSTNAME:=android} : ${SHELL:=$MKSH} ${USER:=$(typeset x=$(id); x=${x#*\(}; print -r -- ${x%%\)*})} if (( USER_ID )); then PS1='$'; else PS1='#'; fi function precmd { typeset e=$? (( e )) && print -n "$e|" } PS1='$(precmd) $USER@ $HOSTNAME:${PWD:-?} '"$PS1 " export HOME HOSTNAME MKSH PS1 SHELL TERM USER alias l='ls' alias la='l -a' alias ll='l -l' alias lo='l -a -l' for p in ~/.bin; do [[ -d $p/. ]] || continue [[ :$PATH: = *:$p:* ]] || PATH=$p:$PATH done unset p : place customisations above this line 
+6
source share
1 answer

You can change the PS1 prompt as something smaller with the line:

 PS1="> " 

but it would probably be better to increase the width of the window with something like:

 COLUMNS=150 
+4
source

All Articles