Use the input value for the first line and shift stack lookups down for subsequent lines during edit mode. Also route Enter through execute() so editing state is handled consistently before re-rendering.