Live data from Hacker News

What happens when you open a terminal and enter `ls’

warp.dev

41–50 of 60 posts

Re: What happens when you open a terminal and enter `ls’

#41
post #32
post #31

I want to use Warp but it has forced telemetry. Any roadmap for making this more private? Would happily give you my money

Warp actually made telemetry optional last month https://www.warp.dev/blog/telemetry-now-optional-in-warp

Now let us compile the source without the code at all.

A terminal should only do anything when the user types something and presses enter, and then it should only do what the user told it to do. The idea that it goes off to the network unasked is beyond invasive.

But good move. The idea of a terminal tracking my typings and commands is pretty scary stuff, especially if I'm going to use this thing for security sensitive sessions.

Re: What happens when you open a terminal and enter `ls’

#42
post #17

One thing that is missing is the termcap/terminfo system. For funsies, you can try to run your session with TERM=dumb to get a retro experience :)

terminfo would be a good topic for a couple blogposts for sure. Back when I was first learning all this stuff I never felt like I truly understood all the intricacies of this system. I tried to understand back when alacritty made it's own entry, but a lot of things still feel somewhat arcane.

Basically, it's a capability list though, IIUC.

Re: What happens when you open a terminal and enter `ls’

#43
post #21

That article starts with too many inaccuracies to recommend it to anybody: - Teletypes were designed about a century before the era of mainframes. - Mechanical teletype did not have an "I/O driver" in it. - OS on Mainframe computers did not have a "Kernel", and neither "I/O driver", "Line discipline" or "TTY driver". This model was introduced with UNIX, the OS that ran on minicomputers. - Was ChatGPT used to write th…

> That article starts with too many inaccuracies to recommend it to anybody

Why would you even read it after reading the title?

Re: What happens when you open a terminal and enter `ls’

#44

Earlier quoted context omitted.

On the old terminals, the wire sits at one voltage level until a character is transmitted. After that, the bits are spaced out at agreed-upon time intervals. So the receiver detects the first transition, and then reads and stores the bits by applying the same timing, then waits for the next character. Meanwhile, the value of that character, say an 8-bit number, is stored in a register, and typically the processor is…

In the olden days, I'd drive my Fred Flintstone car to work. Serial I/O was done by wire-wrapping a UART chip on the board, which handled all the dirty details. https://en.wikipedia.org/wiki/8250_UART Though the UART chip I used was years earlier than that. Perhaps the Wikipedia article is wrong on that point.

On my first PC, the serial port was an add-on board, and I wire-wrapped one to save a few bucks. My hands were trembling as I powered it up. I don't remember the chip either. Next time I "wired" a UART, it was built into a microcontroller. I also bit-banged one for the PIC16C84 MCU.

But asynchronous serial isn't completely obsolete yet. It just has more protocol layers on top of the physical layers.

Re: What happens when you open a terminal and enter `ls’

#46
post #21

That article starts with too many inaccuracies to recommend it to anybody: - Teletypes were designed about a century before the era of mainframes. - Mechanical teletype did not have an "I/O driver" in it. - OS on Mainframe computers did not have a "Kernel", and neither "I/O driver", "Line discipline" or "TTY driver". This model was introduced with UNIX, the OS that ran on minicomputers. - Was ChatGPT used to write th…

[deleted]

Re: What happens when you open a terminal and enter `ls’

#47
post #13
post #12

Earlier quoted context omitted.

Would you pass this test if instead you answered what would happen if you open a terminal in a made-up operating system and you essentially designed the whole thing in your answer?

I would prefer this answer, it shows an ability to create anew rather than memorize rote.

Now with this article memorized one could answer this question with rote memorization.

However most people are unlikely to have done that.

Instead if someone can provide a good answer they are demonstrating a deep understanding.

Re: What happens when you open a terminal and enter `ls’

#48

> ASCII text would be transmitted character-by-character over the wire as the user typed. How does that work exactly on a lower level, say the current? ASCII text would be decoded to the binary and 1s would be high voltage and 0s would be low? And if there's no data transmitted it would be all low voltage?

I binged CuriousMarc’s YouTube series on teletype restoration a few months ago, so here’s a simplified (and possibly somewhat inaccurate) explanation of how one works.

The only electrical components in a Teletype are (a) a continuously-running electric motor, and (b) an electromagnet and a few switches. Everything else is completely mechanical.

The Teletypes in a circuit, and the electromagnet and switches within them, are all connected in series, forming a current loop. (Current, rather than voltage, is used because you can use a constant-current power supply to get the same power at each electromagnet regardless of how many are in the circuit and how many miles of wire are between them.)

When the circuit is idle, current is flowing. This allows any Teletype to begin transmitting; if it were the other way around, each one would need its own individual line power supply. (Incidentally, this is the origins of the “break” key still found on many modern keyboards: when the circuit was disconnected, nobody could transmit, so “breaking in” to the circuit was how you interrupted somebody, and a lot of early computers used this as a primitive version of ^C.)

When you press a key, a rod is lifted, activating a clutch that connects the motor to the rest of the machine, which starts running. The first thing this does is break the circuit, deactivating the electromagnets in the receiving mechanisms of all the other Teletypes. When this electromagnet deactivates, it trips the clutch in those machines, starting them running so they can receive the character. (This is why it’s called the “start bit.”)

One-tenth of the way through the rotation, a cam in the sending machine switches from the “start bit” to the switch for the first data bit. If the rod on the key you pressed has a bump on it in the right spot, it will press this switch and send a “mark”; if it’s missing the bump you’ll get a “space” instead. On the receiving end, a clever mechanism connects the electromagnet to a lever: if the magnet engages, it pushes the lever one way; and if it doesn’t, the lever stays pushed the other way.

At two-tenths of the rotation, the first data bit switch is disconnected and the second data bit switch engages. This of course reads the second bump on the rod, and at the receiving end the clever mechanism has moved so the magnet pushes (or doesn’t) the second lever.

(Notable exceptions: the ‘ctrl’ key forces the first two bits low—this is why e.g. Ctrl+D and “End of Transmission” are the same—and ‘shift’ forces the first bit high.)

At three-tenths of the rotation, of course, the third bit is read, transmitted and received; this process continues for the remaining data bits.

The final two-tenths of the rotation are known as the “stop bits”, and consist of some signal that doesn’t matter much. The receiving end uses this time to trip the print mechanism: the levers that were pushed-or-not during the data bits engage with some bumps in some other rods, blocking all but one of them that matches the specific pattern, and then a thingie shoves forward, slamming the appropriate type bar up into the ribbon and paper, and as it returns the carriage advances one character. (The reason for using two bits is simply to give some time for all of this to happen.)

Finally, the mechanisms on the sending and receiving ends complete their full rotation, disengaging the clutch and coming to an abrupt halt; the transmitting end reconnects the line so the circuit is available, and everything is ready for the next character. All of this has happened in less than a tenth of a second, a mechanical ballet choreographed too fast for the human eye to see, and transmitting information potentially hundreds of miles at the speed of light.

Re: What happens when you open a terminal and enter `ls’

#49

Earlier quoted context omitted.

In the olden days, I'd drive my Fred Flintstone car to work. Serial I/O was done by wire-wrapping a UART chip on the board, which handled all the dirty details. https://en.wikipedia.org/wiki/8250_UART Though the UART chip I used was years earlier than that. Perhaps the Wikipedia article is wrong on that point.

On my first PC, the serial port was an add-on board, and I wire-wrapped one to save a few bucks. My hands were trembling as I powered it up. I don't remember the chip either. Next time I "wired" a UART, it was built into a microcontroller. I also bit-banged one for the PIC16C84 MCU. But asynchronous serial isn't completely obsolete yet. It just has more protocol layers on top of the physical layers.

I had a design notebook for the project, which included all the datasheets for the various chips. Dammed if I know what happened to it.

Re: What happens when you open a terminal and enter `ls’

#50
post #39

Earlier quoted context omitted.

Another issue is that when an update is available I need to be able to tell Warp that I don’t care at the moment. Due to the corporate software on my work Mac auto-updates fail. Ordinarily this isn’t a huge deal as I’ll just download the DMG and replace it manually. But Warp drops down an obtrusive overlay and you can’t dismiss it until you update. I tried to like it, but little forced choices like that sent me back…

Hey, sorry about that! We actually have a WIP fix for this exact issue (the obtrusive overlay that you can't dismiss). Should be out in the next week or two.

Great to hear, looking forward to trying Warp once again! It did have some really handy stuff built in.
Post reply on HN