Optimised code a bit

this commit makes the shell use the current settings, so you can change
settings while the operation is running.