signalapp / Signal-Desktop

A private messenger for Windows, macOS, and Linux.
https://signal.org/download
GNU Affero General Public License v3.0
14.29k stars 2.59k forks source link

Feature Request: Newline with Enter key #4681

Closed ghost closed 2 years ago

ghost commented 3 years ago

Would it be possible to have the option to send the message with Ctrl+Enter and press Enter for a line break instead of sending the message with Enter?

The current behavior is Latin character-centric. It is not suitable for Enter-heavy CJK characters.

Maltergate commented 3 years ago

I would also add that it prevents sending plenty of short messages as typing on a real keyboard also makes one more verbose.

Thank you

martineizayaga commented 3 years ago

On mac you can do Shift+Enter for a line break

Maltergate commented 3 years ago

On mac you can do Shift+Enter for a line break

Sure, and on Linux and Windows as well. The feature requested is to be able to set in the preferences a behaviour change so that, upon the user's preference, Enter makes a line break and Shift+Enter sends the message. Or simply (being consistent with other messaging apps) being able to disable the "Send with Enter" so that to send the message (with this option activated) one has to click on "Send" and therefore "Enter" inputs a line break.

martineizayaga commented 3 years ago

I can take this issue if that's good with everyone

Maltergate commented 3 years ago

Thanks! In the meantime however I’ve discovered this behaviour (enter = line break) when one expands the text entry field with the little arrow, middle top of the field. Clicking on it the field expands and becomes several lines high, a « send » button appears, and Enter adds a line break.

https://i.imgur.com/nDDLC6d.png https://i.imgur.com/Yvl0sEe.png

This is exactly what I was looking for. It would be nice if it was possible to make it default behaviour (an option so that when opening a conversation the app is already on several lines input by default).

EvanHahn-Signal commented 3 years ago

As @Maltergate points out, you can expand the composer before sending a message. This may address your issue, but it may not because you have to change it every time.

@martineizayaga Thanks for offering to pick up the issue. Please wait until we’ve figured out exactly what we want before you start implementing—we don’t want to waste your time.

I'll follow up with our Design team in 2021 to see about adding a preference to change this.

martineizayaga commented 3 years ago

Ok! I just want to let you know that I've been working on it and this is what I got so far.

Screen Shot 2020-12-18 at 5 21 09 PM

https://user-images.githubusercontent.com/28035767/102666841-e8482580-4155-11eb-9ff7-82e56cbcc7ed.mov

martineizayaga commented 3 years ago

I'm working on the newline-with-enter branch.

direc85 commented 2 years ago

I can't find that branch anymore. Is this work dropped?

navid-zamani commented 1 year ago

For everyone looking for a solution out there:

Just patch it quickly, with this little shell script:

#! /bin/bash

# Signal-Desktop-Unterhaltungsentblöder: Nachrichten abschicken NUR mit Shift-Enter/Ctrl-Enter. NICHT mir nur Enter! Enter ist für Zeilenumbrüche! Damit Unterhaltungen nicht auf Twitter-Niveau beschränkt werden!

asar="/opt/Signal/resources/app.asar"
tmp="/tmp/Google Web Cancer. Kill it with fire!"
geheilt="/tmp/geheilt.asar"

[[ -e "$(which npx)" ]] || { echo "Fehler: »npx« ist nicht installiert."; exit 1; }
[[ -e "$asar.Krebsgeschwür" ]] && { echo "Anscheinend schon entblödet. Wenn dies eine neue Version ist, »sudo mv -f $asar.Krebsgeschwür $asar«, dann nochmal ausführen."; exit 2; }

npx asar extract "$asar" "$tmp"
sed -i "s/key: 13,/key: 13, shiftKey: true,/" \
    "$tmp/ts/components/CompositionInput.js" \
    "$tmp/preload.bundle.js"
npx asar pack "$tmp" "$geheilt"
rm -rf "$tmp"

sudo mv "$asar" "$asar.Krebsgeschwür"
sudo mv "$geheilt" "$asar"

It is written for Debian-likes, but of course is easily adapted to other systems.
npx from the npm package must be installed. It will automatically ask you to install asar (which is what we need) on first use.

It will make Enter create a new line, and only submit on Shift-Enter.

navid-zamani commented 1 year ago

I would also add that it prevents sending plenty of short messages

That’s a feature. Nobody wants to converse on the same toxic level as on Twitter (or AIM back in the days). Putting some thought into a message should be a requirement for any healthy, actually grown-up human being.

navid-zamani commented 1 year ago

I’ve discovered this behaviour (enter = line break) when one expands the text entry field with the little arrow, middle top of the field.

Nobody wants to first move his fingers off the keyboard, grab a mouse, precisely hit a teensy-tiny area, and align with the keyboard again though. 😆 Not for something that should be the default in any non-toxic UI.

navid-zamani commented 1 year ago

The developers just declaring bugs they failed fixing for so long they are ashamed of them as ”stale” and closing them as ”completed” is just awesome, by the way…

A true sign of competency and trustworthiness of the software.

sarashino commented 1 year ago

I'm working on the newline-with-enter branch.

@martineizayaga Hi! What happened here? I'm also CJK user as issuer do so, and I don't feel comfortable this issue that send txt by enter honestly. Even telegram or Slack can handle this situation by configuring preferences.

If you do some jobs on this, could I have any chance to get this feature?

image
navid-zamani commented 1 year ago

I just updated the patch script, so it works again:

#! /bin/bash

# Signal Desktop conversation destupidifier:
#     Submit messages with Shift-Enter/Ctrl-Enter ONLY. NOT with just Enter.
#     Enter is for line breaks! So conversations aren’t limited to the level of Twitter!

# ANSI-Schnipsel
ansiInfo=$'\e[92;1m' # Hellgrün, Fett
ansiHinweis=$'\e[93;1m' # Hellgelb, Fett
ansiWarnung=$'\e[31;1m' # Dunkelrot, Fett
ansiEnde=$'\e[0m' # Zurücksetzen

# Ausgabefunktionen
info() { nachricht "$ansiInfo" "$1" "ℹ️ "; } # info <Text>
hinweis() { nachricht "$ansiHinweis" "$1" "ℹ️ "; } # hinweis <Text>
warnung() { nachricht "$ansiWarnung" "$1" "‼️ "; } # warnung <Text>
nachricht() { echo "$1${3:->>>} $2$ansiEnde"; }

# Konstanten
asar="/opt/Signal/resources/app.asar"
tmp="/tmp/Google Web Cancer. Kill it with fire!"
geheilt="/tmp/geheilt.asar"

# Versionserkennung
[[ -e "$(which npx)" ]] || { echo "Error: »npx« in not installed."; exit 1; }
if [[ -e "$asar.Krebsgeschwür" ]]; then
  info "Wurde schon ausgeführt,"
  if diff -q "$asar" "$asar.Geheilt" > /dev/null; then
    warnung "No new version. So I’ll first restore the backup of the cancerous version…"
    sudo mv -f "$asar.Krebsgeschwür" "$asar"
  else
    hinweis "New version detected. So first I’ll forget the backup of the old cancerous version…"
    sudo rm -f "$asar.Krebsgeschwür"
  fi
  hinweis "Forgetting cured version…"
  sudo rm -f "$asar.Geheilt"
fi

# Heilung
echo "Extracting…"
npx asar extract "$asar" "$tmp"
echo "Applying chemo…"
sed -ri 's/key:( *)13,/key:\113,\1ctrlKey:\1true,/g' \
    "$tmp/ts/components/CompositionInput.js" \
    "$tmp/preload.bundle.js"
echo "Re-packing…"
npx asar pack "$tmp" "$geheilt"
rm -rf "$tmp"

# Installation
echo "Backing up cancerous version…"
sudo mv "$asar" "$asar.Krebsgeschwür"
echo "Installing cured version…"
sudo mv "$geheilt" "$asar"
sudo ln -fn "$asar" "$asar.Geheilt"
hinweis "Finished."