Earlier quoted context omitted.
dont try to code while standing on a train. one of many antpatterns a wise engineer should learn to avoid, as part of polishing our craft. also: dont juggle chainsaws, etc ;-)
but also dont try coding on a laptop. use a proper desktop, or better yet, get time on a mainframe. the problem has been solved forever, juat do work from the workplace at a dedicated terminal, built for doing that work at.
Regarding terminals, how often does this requirement occur in practice? Assuming it does, you can probably use your laptop for it, in which case, see above.