@@ -246,6 +246,17 @@ function _cleanup {
246246 fi
247247}
248248
249+ # ##############################################################################
250+ # normalize croc's terminal output and suppress update notices
251+ function _filter_croc_output {
252+ LC_ALL=C sed -u -E \
253+ -e $' s/.*\r //' \
254+ -e ' /^A newer croc version is available:/d' \
255+ -e ' \|^Run: curl https://getcroc\.com \| bash$|d' \
256+ -e ' /^Or open:$/d' \
257+ -e ' \|^[[:space:]]*https://getcroc\.com/\?code=|d'
258+ }
259+
249260# ##############################################################################
250261
251262trap " _cleanup" EXIT
@@ -284,7 +295,9 @@ if [[ -n "${PORTS}" ]] && [[ "${MODE}" == "tx" ]] && (( $# > 0 )); then
284295 [[ -n " ${SEND_RELAY_IP} " ]] && RELAY_ARGS=(--relay " ${SEND_RELAY_IP} :${FIRST_PORT} " )
285296
286297 # run croc
287- " ${CROC_BIN} " --yes --ignore-stdin --overwrite ${DEBUG_FLAG} " ${CURVE_ARGS[@]} " " ${RELAY_ARGS[@]} " send " ${HASH_ARGS[@]} " " $@ "
298+ " ${CROC_BIN} " --yes --ignore-stdin --overwrite --disable-clipboard ${DEBUG_FLAG} \
299+ " ${CURVE_ARGS[@]} " " ${RELAY_ARGS[@]} " send \
300+ " ${HASH_ARGS[@]} " " $@ " 2>&1 | _filter_croc_output
288301
289302elif [[ -n " ${PORTS} " ]] && ( [[ " ${MODE} " == " rx" ]] && [[ -n " ${TOKEN} " ]] && ( [[ -z " ${LOCAL_RELAY} " ]] || [[ -n " ${SERVER} " ]] ) ); then
290303 # we have ports defined, have requested receive mode, have been given a token, and either have a relay IP or are not using a local relay
@@ -293,7 +306,9 @@ elif [[ -n "${PORTS}" ]] && ( [[ "${MODE}" == "rx" ]] && [[ -n "${TOKEN}" ]] &&
293306
294307 # run croc
295308 export CROC_SECRET=" ${TOKEN} "
296- " ${CROC_BIN} " --yes --ignore-stdin --overwrite ${DEBUG_FLAG} " ${CURVE_ARGS[@]} " " ${RELAY_ARGS[@]} " " ${OUTPUT_ARGS[@]} "
309+ " ${CROC_BIN} " --yes --ignore-stdin --overwrite --disable-clipboard ${DEBUG_FLAG} \
310+ " ${CURVE_ARGS[@]} " " ${RELAY_ARGS[@]} " \
311+ " ${OUTPUT_ARGS[@]} " 2>&1 | _filter_croc_output
297312
298313else
299314 _help >&2
0 commit comments