You cannot hack a terminal while in stealth because the moment you interact with the terminal, your character stands up, then goes to the terminal - effectively alerting all surrounding enemies. Then once you tab away from the terminal, your character is no longer in stealth, but just standing out in the open like an idiot.
Does Bethesda really hate stealth players? It's bad enough we can destroy search lights but we have to deal with invincible flood lights, but now we can't even hack a computer in stealth? I really hope this issue gets fixed by a patch or mod.