fix completion (sorting, add / at end of dir, ~