fix cd_beagrep for X

Signed-off-by: Bao Haojun <baohaojun@gmail.com>