Copy code out of a screenshot

loupe ●○○

Select a region of the screen, OCR it, and put the text on your clipboard. The --literal flag stops the OCR engine from "correcting" identifiers into dictionary words, so usr_cnt stays usr_cnt and your typos stay yours. Indentation is not preserved, so run a formatter afterwards.

$ screencapture -i snip.png && loupe ocr --literal snip.png | pbcopy
$ pbpaste
export GIT_AUTHR=georg const recieve_mesage = usr_cnt + tmp_buf; let teh_valu = calulate(lenght, wdith); git commit --ammend -m 'fix teh thign' ORDER-ID: QWRT-7731-XPLM
Requires: screencapture (macOS), loupe 0.4.1+