Hurray, I can now press gg instead of g to go to the top in tt. Much better! :-) Other multi-key combinations are also easily possible now.
I should probably write a real article about this at some point, but here we go. The only downside with my new key binding system is that it breaks tviewâs established pattern. Youâve got an InputHandler(), that is implemented using WrapInputHandler(âŚ). It typically then directly implements the switching logic depending on the key press. Something like this:
func (w *Widget) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive)) {
// WrapInputHandler allows for intercepting key events with SetInputCapture(âŚ)
// from the outside for customization. This handles the default key bindings.
return t.WrapInputHandler(func(event *tcell.EventKey, setFocus func(p tview.Primitive)) {
switch event.Key() {
case tcell.KeyRune:
if event.Modifiers() == tcell.ModNone {
switch event.Rune() {
case 'k':
w.scrollUp()
return // we already handled the event, stop processing
case 'j':
w.scrollDown()
return
}
}
}
// We didn't handle the key event. Maybe the parent
// widget knows what to do with it.
if handler := w.parent.InputHandler(); handler != nil {
handler(event, setFocus)
}
})
}
From the outside, you can intercept and either stop or continue the widgetâs original key handling with a potentially rewritten key event using SetInputCapture(âŚ):
w := NewWidget()
// customized or additional key bindings
w.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey {
switch event.Key() {
case tcell.KeyUp:
// Rewrite the event, so the "cursor up" key is an alias
// for the vim key binding "k", that is handled by the
// wrapped input handler above. (I know, I know, this is a
// completely unrealistic example, why would anyone use
// cursor keys when there are vim key bindings available?!)
return tcell.NewEventKey(tcell.KeyRune, 'k', tcell.ModNone)
case tcell.KeyRune:
if event.Modifiers() == tcell.ModNone {
switch event.Rune() {
case 'q':
app.Stop()
// we already handled the event, do not pass it
// to the wrapped input handler above
return nil
case 'r':
toggleMessageReadStatus()
return nil
}
}
}
// we didn't handle the event, pass it to the wrapped
// input handler above
return event
}
Since they all expect a single key, Iâve noticed that using multiple dedicated KeyBindings of mine on these different levels kinda breaks multi-key handling with common prefixes. The outer-most KeyBinding captures the prefix, but it canât transfer it to the inner one if not handled by the outer one. At least not without some more (potentially ugly) changes. So, I now have to work with just a single KeyBindings object for the entire widget chain (if it consists of multiple other widgets or the regular input handler and input capture are in the game). The outside needs to register all its key bind customizations or extensions at the same level that the original widget handles its default ones. Doable by exposing the widgetâs KeyBindings instance, but not pretty. You always have to keep this in mind.
With the KeyBindings, it will look like that:
type Widget struct {
parent tview.Primitive
// make it available to children or the outside either by
// direct field access or by providing a getter method
KeyBindings *bind.KeyBindings
}
func NewWidget() *Widget {
w := &Widget{KeyBindings: &bind.KeyBindings{}}
w.KeyBindings. // default key bindings
Bind0(bind.KeySequence('k', w.scrollUp).
Bind0(bind.KeySequence('j', w.scrollDown)
return w
}
func (w *Widget) InputHandler() InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive)) {
return t.WrapInputHandler(func(event *tcell.EventKey, setFocus func(p tview.Primitive)) {
// also note the missing support for focus transfer at the moment
event = w.KeyBindings.Capture(event)
if event == nil {
return
}
if handler := w.parent.InputHandler(); handler != nil {
handler(event, setFocus)
}
}
}
And then from the outside, or in a child widget:
w := NewWidget()
w.KeyBindings. // additional or customized key bindings
Bind1(bind.KeySequence(tcell.KeyUp), func(*tcell.EventKey) *tcell.EventKey {
return tcell.NewEventKey(tcell.KeyRune, 'k', tcell.ModNone)
}).
Bind0(bind.KeySequence('q'), app.Stop).
Bind0(bind.KeySequence('r'), toggleMessageReadStatus)
When directly working with tview primitives that are not part of custom widget implementations, the following works well so far:
textView := tview.NewTextView().
SetWordWrap(true).
SetText("âŚ")
SetScrollable(true)
textView.SetInputCapture((&bind.KeyBindings{}).
Bind0(bind.KeySequence('q'), app.Stop).
Bind1(bind.KeySequence('g', 'g'), func(*tcell.EventKey) *tcell.EventKey {
return tcell.NewEventKey(tcell.KeyHome, 0, tcell.ModNone)
}).
Capture)
I need to sleep on this some more.
Also, writing very long messages like this one is really not all that fun in ttâs editor. I should absolutely provide a way to shell out to vim.
(Took me about one and a half hours to compose, holy crap. But not only because of not using vim. Although, that might have saved me a quarter hour or so for sure. Proof-reading this message also uncovered quite a few bugs in my real documentation. So, thatâs a big win!) Good night!
@prologic@twtxt.net Well, 15 shows the site. On the left, I had a roll mat on a tarp. I borrowed some âNVA tarpsâ from the scouts for this trip. The scouts got them from the National Peopleâs Army, the German Democratic Republicâs armed forces after Germany was reunited. Theyâre 1.75m x 1.75m in size and weigh 1.3kg, quite heavy, but super awesome. One tarp on the bottom, another one to cover up the clothes, shoes and sleeping bag in order to protect against the thaw. Finally, a mosquito net over all that, hung from a rope between two trees.
My mate just used a hammock with a mozzie net on the right hand side. The third tarp served as the luxurious bedside carpet. :-)
We sat on my second tarp to chill and enjoy the sunset and surroundings. It was nice to notice birds etc. die down. It took a really long time for the last light to fade away. Since we have a very high risk of forest fires, we of course couldnât have a camp fire. But after all the exhaustion, I didnât even miss it for one second.
Since we had dinner at home before leaving, all we brought were two lye rolls, two grain rolls, two brezels, some sausage and chocolate biscuits for breakfast. From the 2.5l of water, I ended up using 2l. Itâs always good to have a little extra, despite the unnecessary weight. We had brekkie a few kilometers further on a bench in the shade. The first bench was already in direct sun.
Our camp site was maybe 30m to the side and a few meters down of a summit path hidden behind some trees and bushes. We were quite lucky, the other side of the hill got quite a bit of a breeze at night. We could hear the leaved treetops making much more noise behind us.
@movq@www.uninformativ.de Yes, these kind of dogs should really be strictly forbidden!
Itâs not illegal if you own the forest or ask the owner. :-)
@david@daiwei.me Yeah, no clue. But my mate said the dog is disqualified from such adventures in the future. :-)
The temps were supposed to hit 14°C just before sunrise. Since we didnât bring a thermometer, I canât tell for sure. I was rather hot in my sleeping bag, so I had to pull out my arms every now and then. My mateâs sleeping bag was a little lighter and, unfortunately, the zipper jammed up. Since it didnât close all the way, it felt quite a bit cold I was told in the morning. When we got up at 6ish (we said, we donât care about time at all), it was probably already 16°C if not more. I brought a jumper, but a t-shirt was already nice enough to wear. The jumper just served as my pillow. The mercury raised by the minute then.
Yeah, I circled the spot with a biro to keep an eye on it. Until now, thereâs absolutely nothing to see. Looks like I got lucky.
We slept in the forest. It was really great except of my mateâs fucking terror dog who was barking and snarling the entire night to each and every sound. I had maybe half an hour of sleep in total. Despite that, it was pleasantly warm. Well, the night, that is. The heat was brutal during the days. Literally streams of sweat were running down on us on the way there in the evening and back in the morning.
Surprisingly, there werenât any mozzies around at night, I would have lost all safe bets. On the way there, my mate convinced me to take a shortcut through the taller and taller growing grass. Itâs been some time that somebody traveled on this track, so we had to search around a bit for the overgrown path where we could cross the mostly dried up creek. In the beginning I said that this will be a bad idea. Lo and behold, I discovered a tick on my inner upper leg the next morning. Luckily, I got it out with my tick hook on the first attempt.
@movq@www.uninformativ.de Oh my! :-O We reached 38°C. Itâs now down one degree.
I just got up from my two, three hours siesta. And I tell you, that was bloody amazing. Layed in bed in undies, no blanket, just some power metal in my headphones and I was sleeping like a baby. Normally, I NEED a blanket, no matter what. But this summer, itâs already the second time that I actually manage to drop off without one.
@prologic@twtxt.net Very cool! đ
Just one question: when do you sleep? đ
Just finished watching They Live (1988) again, one of my favorite movies, and one that has (sadly) remained relevant for nearly 40 years (some might even argue itâs more relevant today than ever).
Obey. Consume. No independent thought. Honor apathy. Do not question authority.
They live, we sleep.
Rachel Judge: When sleeping on the job is not enough to justify dismissal
With the Fifa World Cup kicking off today, some fans will have a busy viewing schedule to fit in around working hours. With a few early morning starts, staying awake for the rest of the day may become tricky. Where does that leave you if you fall asleep on the job? Recent case law shows that justifying dismissal in this situation is harder than you may think.
A Sydney security gu ⌠â Read more
As I said, Iâm on vacation, and for about a week now, I did basically nothing but sleep. Day or night.
I canât tell if this actually is a vacation or just therapy for burnout. đ¤
Donald Trumpâs NBA Finals âNapâ Sparks Jimmy Kimmelâs Hysterical Reaction
Jimmy Kimmel, a vocal critic of Donald Trump, reacted to footage that appeared to show the President dozing off while attending the NBA Finals, where the New York Knicks faced the San Antonio Spurs. Trumpâs appearance at the game had already generated discussion online due to heightened security measures. However, Kimmel focused primarily on the [âŚ]
The post [Donald Trumpâs NBA Finals âNap ⌠â Read more
The CCTV images that helped sink a Sydney hostelâs rooftop visions
Residents of two high-end Sydney apartment blocks say they have spent years pleading for a decent nightâs sleep. Now theyâve clocked up a significant victory. â Read more
Sai made an impossible choice about his health. Now heâs afraid to sleep at night
After Sai Akunuri bought his first family home, he was faced with a hard decision: Keep his life-saving diabetes device, or pay his mortgage. â Read more
I tried Googleâs new health app. It canât replace a real trainer
Over the past few weeks, Googleâs omniscient Coach has messaged me constantly about my heart, sleep and exercise. But how capable is it? â Read more
Loop Earplugs Discount Codes: 40% Off
Save on Loop Earplugs, including Quiet 2 and popular gift sets for improved sleep, focus, and comfort. â Read more
Layla Sleep Coupon: Save Up to $600 in June 2026
Upgrade your sleep setup with the latest Layla promo codes. Save on flippable mattresses, copper-infused pillows, and adjustable bases during the Spring Sale. â Read more
Best Sleep Trackers of 2026: Oura, Whoop, and Eight Sleep
I tested the top sleep wearables for every type of sleeper, including devices from Oura, Whoop, and Eight Sleep. â Read more
@prologic@twtxt.net you went to sleep so early! Itâs barely 14:19. đ
@prologic@twtxt.net (I hope Iâm not too incoherent. I didnât sleep very well recently and have a lot of unrelated stuff on my mind. đ¤Ł)
RBNZ not losing sleep over Budget 2026 â for now
Reserve Bank of New Zealand officials are not expecting Budget 2026 to be inflationary, although Governor Anna Breman said she would wait and see what Finance Minister Nicola Willis says.
Willis is due to release Budget 2026 at 2pm on Thursday. â Read more
Why Do We Sleep Under Blankets, Even on the Hottest Nights? (2017)
Article URL: https://www.atlasobscura.com/articles/blankets-summer-hot
Comments URL: https://news.ycombinator.com/item?id=48263711
Points: 19
# Comments: 1 â Read more
A healthy naked sleep (momisan) [blue archive] â Read more
3 Best Smart Ring Brands: Oura, RingConn, and Samsung (2026)
A svelte smart ring can track important activity, sleep, and health metrics. Plusâunlike most smartwatchesâit doesnât need to be charged every day. â Read more
The Best Outdoor Deals From the REI Anniversary Sale 2026
Itâs the best time of year to pick up all the outdoor gadgets, tents, sleeping bags, and other gear youâll need for summer fun. â Read more
Stearns and Foster Promo Codes: $300 Off in May
Discover the best Stearns and Foster promo codes, discounts, and deals to elevate your sleep experience with premium comfort and quality. â Read more
Google Search Goes Agenticâand Doesnât Need You Anymore
Vibe-coded results! Super widgets! Bots that never sleep! Googleâs vision for the future of Search is hyper-personalized, automated, and extremely AI. â Read more
30% Off Tempur-Pedic Promo Codes | May 2026
Whether youâre looking to upgrade your mattress or swap out your bedding, browse our Tempur-Pedic coupons for up to $300 off and the best sleep of your life. â Read more
I wanted to hate this weird travel accessory. Then I slept soundly in economy
By Natalie B. Compton
It sounded like a gimmick youâd see on a late-night infomercial. A polyester arm sling that can help you sleep soundly on a plane! And for only US$24.95 (NZ$42.20)! â Read more
The Best Outdoor Deals From the REI Anniversary Sale 2026
Itâs the best time of year to pick up all the outdoor gadgets, tents, sleeping bags, and other gear youâll need for summer fun. â Read more
Loop Earplugs Discount Codes: 40% Off
Save on Loop Earplugs, including Quiet 2 and popular gift sets for improved sleep, focus, and comfort. â Read more
Sealy Promo Codes: $100 Off
Whether youâre switching from springs to memory foam or just want to sleep cooler this summer, these Sealy mattress deals will have you waking up refreshedâand with cash left in your wallet. â Read more
Sleep Number ComfortNext Lux Smart Bed: Redefining Support
Sleep Numberâs new model leans plush, but its smart support might convert even die-hard firmness fans. â Read more
Layla Sleep Coupon: Save Up to $600 in May 2026
Upgrade your sleep setup with the latest Layla promo codes. Save on flippable mattresses, copper-infused pillows, and adjustable bases during the Spring Sale. â Read more
Loop Earplugs Discount Codes: 40% Off
Save on Loop Earplugs, including Quiet 2 and popular gift sets for improved sleep, focus, and comfort. â Read more
Best Side-Sleeper Mattresses 2026: Picked by a Sleep Science Coach
Weâve tested hundreds of the top hybrid, memory foam, and cooling mattresses to find the best combination of support and pressure relief. â Read more
Smart Cat Collars: Which Is Best for Health and GPS Tracking?
I pitted Tractive and Fi Mini smart cat collars against each other to crown the best for activity, sleep, and GPS tracking. â Read more
What Type of Mattress Is Right for You? (2026)
Hereâs how to pick the best mattress for your sleep needs, straight from a professional mattress tester. â Read more
Zig 0.16.0 released
The Zig project has announced version
0.16.0 of the Zig programming language.
This release features 8 months of work: changes
from 244 different contributors, spread among
1183 commits.Perhaps most notably, this release debuts I/O\â¨> as an Interface, but donât sleep on the [Language\â¨> Chan ⌠â Read more
Good morning. Did you sleep better next to a stacked hottie? â Read more
@prologic@twtxt.net Awwwwwwww! I love these stripes, very cool!
Oh, I bet these inclines are no joke. I also know one about 200 meters long terribly steep dirt path up a hill around here. Climbing that is super exhausting. I just looked it up on a map. And itâs just ~17° or ~30% incline. Okay, thatâs absolutely nothing compared to your adventure. :-D
But you got your exercises for the day then. Which will make for an even greater sleep tonight. ;-)
2nd Van trip coming up this weekend, taking Friday off work. Gonna sleep in the Van tonight and see if I can fiddle with the town water supply (basically our outside tap near the Van haha đ) and see if I can have a shower in the Van, brush my teeth and go to bed đ â Basically I just want to figure out the rest of the plumbing đŞ
@movq@www.uninformativ.de @lyse@lyse.isobeef.org Itâs not that bad. She let me sleep three times last night alone!
@falsifian@www.falsifian.org Congrats, mate, no sleep at night anymore! ;-D Thatâs a cool age measuring blanket. Havenât seen something like that before.
Btw. the index.html includes an out of place </ul>. And I just wanna let you know that the full-size photos donât load for me over here across the pond. They always run into a timeout after a few slooow percent. But no worries. :-)
Wel⌠It was a very comfortable nightâs sleep đ´
sleeping in my van tonight, which is parked outside the front of our house just as a test from overnight đ
What a beautiful, beautiful 0°C Sunday arvo and evening! The weather forecast delayed the snow by the minute. An hour or so after it finally started very, very lightly, I headed off for the woods to check out the lake again. Unfortunately, with the fresh snow layer, the crazy wild surface texture of the ice sheet wasnât visible anymore. But it brought some other nice views and photo opportunities.
I initially thought that I just go for a quick turn. However, with the snowfall a wee bit increasing I was hooked and kept going. Visibility was poor, but the snow blankets just looked too stunning. The road surfaces were quite slippery, so I often just walked alongside the pathways. On downhill slopes I had some good fun sliding down the road on my feet. With varying success. Luckily, I managed not to fall.
On the summit of the mountain the twigs had those absolutely magnificently looking windblown crystal coverings. Awwwwwww! They never get old. It was already getting dark, so the camera was tired and wanted to sleep. The snow program then made use of the flash and Iâm quite pleased with how these shots turned out.
Two deer crossed the road in front of me and ran into the woods, that was sight for sore eyes. Although I felt bad that they had to flee from me in this white terrain. By the time I got home, the snow had accumulated around eight centimeters in height, even in town down in the valley. Walking on this fresh snow is just amazing. And I love the sound it makes. Today, the snow consistency must have been just right, because the crushing sound was really loud.
I cannot recall that I had frozen hair and beard before, but today, there was a thick ice buildup. In case I had, it was definitely never this much. Felt really cool.
Enough of this preliminary skirmishing, there ya go: https://lyse.isobeef.org/waldspaziergang-2026-01-25/
Poor Sleep Quality Accelerates Brain Aging
A large-scale study tracking more than 27,500 middle-aged and elderly people over roughly nine years has found that poor sleep quality is associated with accelerated brain aging, and chronic inflammation appears to be one of the key mechanisms driving this effect.
Researchers at Swedenâs Karolinska Institute assessed participantsâ sleep across five dimensions â chronotype, duration, i ⌠â Read more
How worried should you be about spending too much time on your phone?
Screen time has been linked to all sorts of problems, from depression and obesity to poor sleep. But how worried should you really be? Jacob Aron sifts through the evidence â Read more
Zig Quits GitHub, Says Microsoftâs AI Obsession Has Ruined the Service
The Zig Software Foundation has quit GitHub after years of unresolved GitHub Actions bugs â including a âsafe_sleepâ script that could spin forever and cripple CI runners. Zig leadership puts the blame on Microsoftâs growing AI-first priorities and declining engineering quality. Other open-source developers are voicing similar frustrations. ⌠â Read more
Is it better to sleep naked or wear pyjamas?
What you wear to bed can affect the quality of your sleep. And if thatâs nothing at all, there are a few things to consider. â Read more
Smartphones At Age 12 Linked To Worse Health
A new study from the University of Pennsylvania finds that preteens who own smartphones by age 12 have significantly higher odds of depression, obesity, and poor sleep compared to their peers. Axios reports: Kids who owned a smartphone at age 12 were found to have about 31% higher odds of depression, 40% higher odds of obesity and 62% higher odds of insufficient sleep than their peers ⌠â Read more
@prologic@twtxt.net donât seek the problems. If they exist, they will show at your doorstep. Hahahaha! Anyway, shame on me, I should be sleeping, so I ought to.