Skip to content

Commit a6bf405

Browse files
Praveen Chaudharyqiluo-msft
Praveen Chaudhary
authored andcommitted
[data/etc/bash_completion.d/sonic-clear] Issue: clear tab completion shows garbage value (sonic-net#269)
$ clear ^[[3;J^[[H^[[2J Changes : 1.) Have bash_completion function for sonic-clear command instead of clear command. 2.) Use the same completion function for clear[/usr/bin/clear] as well. 3.) Change name of _clear_completion to _sonic_clear_completion. 4.) Replace $1 with "sonic-clear" in _sonic_clear_completion, so that it can be reused for clear. Signed-off-by: Praveen Chaudhary <[email protected]>
1 parent 5baa305 commit a6bf405

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
+4-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
_clear_completion() {
1+
_sonic_clear_completion() {
22
COMPREPLY=( $( env COMP_WORDS="${COMP_WORDS[*]}" \
33
COMP_CWORD=$COMP_CWORD \
4-
_CLEAR_COMPLETE=complete $1 ) )
4+
_SONIC_CLEAR_COMPLETE=complete sonic-clear ) )
55
return 0
66
}
77

8-
complete -F _clear_completion -o default clear;
8+
complete -F _sonic_clear_completion -o default sonic-clear;
9+
complete -F _sonic_clear_completion clear;

0 commit comments

Comments
 (0)