How does the direct TCP mode work?
492 karma · joined January 12, 2011
How does the direct TCP mode work?
What's your approach?
The exact same approach is recommended in the book "Working effectively with legacy code" by Michael Feathers, with several techniques on how to do it. He describes legacy code as 'code with no tests'.
You're typing a long command, then before running it you remember you have to do some stuff first. Instead of Ctrl-C to cancel it, you push it to history in a disabled form.
Prepend the line with # to comment it, run the commented line so it gets added to history, do whatever it is you remembered, then up arrow to retrieve the first command.
$ long_command
<Home, #>
$ #long_command
<Enter>
$ stuff_1 $ stuff_2
<Up arrow a few times>
$ #long_command
<home, del>
$ long_command
Eventually I moved to using vscode for both. My gigantic notes.md file is always open in tab 1, so I can go to it immediately with Ctrl + 1.
Finding notes in a single file is easier for me than finding them in a bazillion tiny files. And there's less friction whenever I need to make a note (no need to create and name a new file).
A similar idea is present in Herbert Simon's 'The sciences of the artificial', where he describes a sentient city.