David Glasser
05/03/2023, 10:32 PMcurl
to have API responses end in newlines before the prompt. I don't see a way to teach a Jackson ObjectMapper to do that, so it seems like I'll need my own copy of JacksonConverter that just adds a single newline after calling objectMapper.writeValue
, which seems like a lot?David Glasser
05/03/2023, 10:40 PMval MyMapperButWithTrailingNewlineAfterWriteValue = object : ObjectMapper(MyMapper) {
override fun writeValue(out: OutputStream, value: Any?) {
super.writeValue(out, value)
out.write('\n'.code)
}
}
BryanT
05/03/2023, 10:53 PMDavid Glasser
05/03/2023, 10:53 PMout
ephemient
05/03/2023, 10:55 PMObjectMapper().enable(SerializationFeature.INDENT_OUTPUT)
David Glasser
05/03/2023, 10:56 PMBryanT
05/03/2023, 10:56 PMDavid Glasser
05/03/2023, 10:56 PMDavid Glasser
05/03/2023, 10:56 PMBryanT
05/03/2023, 10:56 PMDavid Glasser
05/03/2023, 10:57 PMout)
BryanT
05/03/2023, 11:06 PMDavid Glasser
05/03/2023, 11:07 PMephemient
05/03/2023, 11:07 PMephemient
05/03/2023, 11:07 PMPROMPT_SP
and PROMPT_EOL_MARK
David Glasser
05/03/2023, 11:08 PMval MyMapperButWithTrailingNewlineAfterWriteValue = object : ObjectMapper(MyMapper) {
init {
disable(AUTO_CLOSE_TARGET)
}
override fun writeValue(out: OutputStream, value: Any?) {
super.writeValue(out, value)
out.write('\n'.code)
out.close()
}
}
David Glasser
05/03/2023, 11:08 PMephemient
05/03/2023, 11:08 PMcurl | jq
anyway, and then newlines don't matterDavid Glasser
05/03/2023, 11:09 PMDavid Glasser
05/03/2023, 11:10 PMephemient
05/03/2023, 11:13 PMephemient
05/03/2023, 11:18 PM__warn_missing_nl_start=$(tput -S 2>/dev/null <<END
sgr0
bold
setaf 1
END
) __warn_missing_nl_end=$(tput sgr0 2>/dev/null)
PROMPT_COMMAND="printf ${__warn_missing_nl_start@Q}'%-*s'${__warn_missing_nl_end@Q}'\\r' \"\${COLUMNS}\" '\\' 2>/dev/null${PROMPT_COMMAND:+; ${PROMPT_COMMAND}}"
in my ~/.bashrc
but really this can be customized to whatever you like