Skip to content

Commit 9c369f1

Browse files
committed
Handle files with leading at signs, update README
1 parent c6cfe2e commit 9c369f1

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

README.md

+1-8
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,6 @@ GitHub.
167167
will be removed once xterm can handle images greater than 1000x1000.
168168
[Last tested with XTerm(344)].
169169

170-
* Filenames that begin with "@" are special to ImageMagick and it'll
171-
freak out if you don't prepend a directory. (`lsix ./@foo.png`)
172-
(This is a bug in ImageMagick, not lsix).
173-
174-
* Specifying the empty string `""` as a filename makes ImageMagick hang.
175-
(This appears to be an ImageMagick bug / misfeature).
176-
177170
* Long filenames are wrapped, but not intelligently. Would it
178171
complicate this script too much to make it prefer to wrap on whites
179172
space, dashes, underscores, and periods? Maybe.
@@ -274,4 +267,4 @@ GitHub.
274267

275268
* [VT340 Test](https://github.com/hackerb9/vt340test), a project to document the actual behaviour of the DEC VT340 hardware.
276269

277-
* [Digital ANSI-Compliant Printing Protocol: Level 2 Programming Reference Manual](http://www.vaxhaven.com/images/f/f7/EK-PPLV2-PM-B01.pdf), Chapter 5: Sixel Graphics. An excellent and reasonably clear discussion for anyone who wants to generate or parse sixel graphics.
270+
* [Digital ANSI-Compliant Printing Protocol: Level 2 Programming Reference Manual](http://www.vaxhaven.com/images/f/f7/EK-PPLV2-PM-B01.pdf), Chapter 5: Sixel Graphics. An excellent and reasonably clear discussion for anyone who wants to generate or parse sixel graphics.

lsix

+7-2
Original file line numberDiff line numberDiff line change
@@ -234,14 +234,19 @@ main() {
234234
len=${#onerow[@]}
235235
onerow[len++]="-label"
236236
onerow[len++]=$(processlabel "$1")
237-
onerow[len++]="file://$1"
237+
onerow[len++]="file://$(imescape $1)"
238238
shift
239239
done
240-
montage "${onerow[@]}" $imoptions gif:- \
240+
241+
montage "${onerow[@]}" $imoptions gif:- \
241242
| convert - -colors $numcolors sixel:-
242243
done
243244
}
244245

246+
imescape() {
247+
echo "$@" | sed -e 's|^@|./@|g;'
248+
}
249+
245250
processlabel() {
246251
# This routine is all about appeasing ImageMagick.
247252
# 1. Remove silly [0] suffix and : prefix.

0 commit comments

Comments
 (0)