call_shell: Add input/input_len parameters.

Change write_selection() to save_selection().