sh-mode won't care if indent-tabs-mode is on, it will still insert spaces instead of tabs! Can this be fixed?
I'm going to guess that
sh-basic-offset are not aligned.
indent-tabs-mode will only use tabs to indent up to multiples of
tab-width, as otherwise it would indent too much.
That said, I find tabs bad for shell script indentation, as copying and pasting code from a script into a shell running in a terminal can be problematic. I would recommend using spaces for shell scripts for this reason.
Edit: In this instance it was the backspace behaviour which was causing confusion.
C-hkDEL tells me:
DEL (translated from <backspace>) runs the command backward-delete-char-untabify (found in sh-mode-map), which is an interactive compiled Lisp function in ‘simple.el’. It is bound to DEL. (backward-delete-char-untabify ARG &optional KILLP) Delete characters backward, changing tabs into spaces. The exact behavior depends on ‘backward-delete-char-untabify-method’. Delete ARG chars, and kill (save in kill ring) if KILLP is non-nil. Interactively, ARG is the prefix arg (default 1) and KILLP is t if a prefix arg was specified.
Follow the link provided there and set
nil so that it deletes a single character (which should be a tab) each time.