icat: Fix temp files not being deleted when transmitting using escape codes

This commit is contained in:
Kovid Goyal 2017-12-15 13:18:18 +05:30
parent cb04deef63
commit 304f21e79d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -134,6 +134,8 @@ def show(outfile, width, height, fmt, transmit_mode='t', align='center'):
else:
with open(outfile, 'rb') as f:
data = f.read()
if transmit_mode == 't':
os.unlink(outfile)
if fmt == 100:
cmd['S'] = len(data)
write_chunked(cmd, data)